/**
 * @copyright
 * @package     2 Click Social Buttons Pro - 2CSB for Joomla! 6
 * @author      Viktor Vogel <admin@kubik-rubik.de>
 * @version     6.1.0.0-PRO - 2026-07-25
 * @link        https://kubik-rubik.de/2csb-2-click-social-buttons
 *
 * @license     GNU/GPL
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. If not, see <https://www.gnu.org/licenses/>.
 */

#social-bookmarks {
    height: 28px;
    margin: 2px 0;
    overflow: visible;
}

#social-bookmarks ul.social-share {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: visible;
}

#social-bookmarks ul.social-share span.switch {
    background-attachment: scroll;
    background-color: transparent;
    background-image: url("../images/switch.png");
    background-repeat: no-repeat;
    cursor: pointer;
    display: inline-block;
    float: none; /* keep flex vertical centering on the li */
    height: 12px;
    margin: 0 8px 0 0;
    overflow: hidden;
    text-indent: -9999em;
    width: 23px;
    flex: 0 0 23px;
    align-self: center;
}

#social-bookmarks ul.social-share span.switch.off {
    background-position: 0 0;
}

#social-bookmarks ul.social-share span.switch.on {
    background-position: 0 -12px;
}

/* Fixed-width slots prevent layout jump when preview → live widgets */
#social-bookmarks ul.social-share li {
    display: inline-flex;
    align-items: center;
    float: left;
    height: 28px;
    margin: 0 12px 0 0; /* space before the next toggle */
    padding: 0;
    background: none;
    vertical-align: middle;
    white-space: nowrap;
    box-sizing: border-box;
    overflow: hidden;
}

#social-bookmarks img {
    opacity: 0.45;
    vertical-align: middle;
}

/* --- Width reservation (tight fit — gap to next toggle matches LinkedIn) --- */
/* switch 23+8=31 + control */
#social-bookmarks ul.social-share li#facebook-button,
#social-bookmarks ul.social-share li#facebook-button-on {
    width: 134px; /* 31 + Like|Share (no count) */
    position: relative;
    overflow: visible;
}

#social-bookmarks.has-share-counts ul.social-share li#facebook-button,
#social-bookmarks.has-share-counts ul.social-share li#facebook-button-on {
    width: 150px; /* 31 + Like|0|Share */
}

#social-bookmarks ul.social-share li#twitter-button,
#social-bookmarks ul.social-share li#twitter-button-on {
    width: 97px; /* 31 + 66 preview */
    overflow: visible;
}

#social-bookmarks.has-share-counts ul.social-share li#twitter-button,
#social-bookmarks.has-share-counts ul.social-share li#twitter-button-on {
    width: 112px; /* Post + compact count badge */
}

#social-bookmarks ul.social-share li#whatsapp-button,
#social-bookmarks ul.social-share li#whatsapp-button-on {
    width: 94px; /* 31 + Share */
    overflow: visible;
}

#social-bookmarks ul.social-share li#telegram-button,
#social-bookmarks ul.social-share li#telegram-button-on {
    width: 94px;
    overflow: visible;
}

#social-bookmarks ul.social-share li#linkedin-button,
#social-bookmarks ul.social-share li#linkedin-button-on {
    width: 94px; /* 31 + 63 preview */
    overflow: visible;
}

#social-bookmarks.has-share-counts ul.social-share li#linkedin-button,
#social-bookmarks.has-share-counts ul.social-share li#linkedin-button-on {
    width: 116px; /* Share|0 */
}

#social-bookmarks ul.social-share li#xing-button,
#social-bookmarks ul.social-share li#xing-button-on {
    width: 93px; /* 31 + 62 preview */
    overflow: visible;
}

#social-bookmarks.has-share-counts ul.social-share li#xing-button,
#social-bookmarks.has-share-counts ul.social-share li#xing-button-on {
    width: 112px; /* Share + compact count badge */
}

#social-bookmarks ul.social-share li#reddit-button,
#social-bookmarks ul.social-share li#reddit-button-on {
    width: 94px;
    overflow: visible;
}

#social-bookmarks ul.social-share li#email-button,
#social-bookmarks ul.social-share li#email-button-on {
    width: 90px;
    overflow: visible;
}

/* X widget iframe is taller than LinkedIn/Xing — keep switch vertically centered */
#social-bookmarks ul.social-share li#twitter-button-on {
    align-items: center;
}

#social-bookmarks ul.social-share li#twitter-button-on .social-btn-wrap--twitter {
    height: auto;
    min-height: 20px;
    align-items: center;
}

#social-bookmarks ul.social-share li#twitter-button-on iframe {
    vertical-align: middle !important;
    margin: 0 !important;
}

#social-bookmarks ul.social-share li#loadall-button,
#social-bookmarks ul.social-share li#load_button_on {
    width: 94px;
}

/* --- Facebook official-style Like | Share (matches preview) --- */
.fb-official {
    display: inline-flex;
    align-items: stretch;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    box-shadow: none;
}

/* Inactive HTML previews — same fade as the old PNG placeholders */
.social-btn-preview {
    opacity: 0.45;
    pointer-events: none;
}

.fb-official__like,
.fb-official__share {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    padding: 0 6px;
    background: #1877f2;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
}

.fb-official__like:hover,
.fb-official__share:hover {
    background: #166fe5;
    color: #fff;
    text-decoration: none;
}

.fb-official__share {
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0 10px;
}

.fb-official__icon {
    display: block;
    flex: 0 0 auto;
}

.fb-official__label {
    display: inline-block;
}

.fb-official__like .social-btn-count {
    margin-left: 2px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: transparent;
    min-width: 0;
    height: auto;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
}

/* --- X (Twitter) Post lookalike --- */
.x-post-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    padding: 0 10px 0 8px;
    background: #000;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    line-height: 1;
    box-sizing: border-box;
}

.x-post-button__icon {
    display: block;
    flex: 0 0 auto;
}

/* --- WhatsApp --- */
.whatsapp-share-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px 1px 6px;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    height: 20px;
    vertical-align: middle;
    box-sizing: border-box;
}

.whatsapp-share-button:hover {
    background: #1ebe57;
    color: #fff;
    text-decoration: none;
}

.whatsapp-share-button__icon {
    display: block;
    flex: 0 0 auto;
}

/* --- Telegram --- */
.telegram-share-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px 1px 6px;
    background: #229ed9;
    color: #fff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    height: 20px;
    vertical-align: middle;
    box-sizing: border-box;
}

.telegram-share-button:hover {
    background: #1b8ec4;
    color: #fff;
    text-decoration: none;
}

.telegram-share-button__icon {
    display: block;
    flex: 0 0 auto;
}

/* --- LinkedIn --- */
.linkedin-share-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px 1px 6px;
    background: #0a66c2;
    color: #fff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    height: 20px;
    vertical-align: middle;
    box-sizing: border-box;
}

.linkedin-share-button:hover {
    background: #004182;
    color: #fff;
    text-decoration: none;
}

.linkedin-share-button .social-btn-count {
    margin-left: 2px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: transparent;
    min-width: 0;
    height: auto;
    border-radius: 0;
}

/* --- Xing Share lookalike --- */
.xing-share-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    padding: 0 8px 0 6px;
    background: #006567;
    color: #fff;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    line-height: 1;
    box-sizing: border-box;
}

.xing-share-button__icon {
    display: block;
    flex: 0 0 auto;
}

/* --- Reddit --- */
.reddit-share-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px 1px 6px;
    background: #ff4500;
    color: #fff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    height: 20px;
    vertical-align: middle;
    box-sizing: border-box;
}

.reddit-share-button:hover {
    background: #e03d00;
    color: #fff;
    text-decoration: none;
}

.reddit-share-button__icon {
    display: block;
    flex: 0 0 auto;
}

/* --- Email --- */
.email-share-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px 1px 6px;
    background: var(--2csb-button-color, #6c757d);
    color: #fff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    height: 20px;
    vertical-align: middle;
    box-sizing: border-box;
}

.email-share-button:hover {
    background: var(--2csb-button-hover-color, #495057);
    color: #fff;
    text-decoration: none;
}

.email-share-button__icon {
    display: block;
    flex: 0 0 auto;
}

/* --- Load all --- */
.loadall-share-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    padding: 0 8px 0 6px;
    background: var(--2csb-button-color, #0f7c7c);
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    line-height: 1;
    box-sizing: border-box;
}

.loadall-share-button__icon {
    display: block;
    flex: 0 0 auto;
}

/* Count badges inside network buttons (never as floating grey pills) */
.social-btn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    line-height: 1;
    box-sizing: border-box;
}

.social-btn-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    vertical-align: middle;
}

.social-btn-wrap .social-btn-count {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e4e6eb;
    color: #050505;
}

.clear {
    clear: both;
}

/* Info tooltip */
#social-bookmarks ul.social-share li#info-button {
    position: relative;
    cursor: help;
    overflow: visible !important;
    z-index: 10000;
    width: 50px;
    margin-right: 0;
}

#social-bookmarks ul.social-share li#info-button .info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #9e9e9e;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    cursor: help;
    user-select: none;
    transition: background 0.2s ease;
    opacity: 0.6;
}

#social-bookmarks ul.social-share li#info-button:hover .info-icon {
    background: #757575;
    opacity: 0.8;
}

#social-bookmarks ul.social-share li#info-button .info-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: #FFFFFF;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 4px;
    white-space: normal;
    width: 280px;
    max-width: 280px;
    text-align: left;
    z-index: 13000;
    pointer-events: none;
    box-sizing: border-box;
    word-wrap: break-word;
}

#social-bookmarks ul.social-share li#info-button .info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

#social-bookmarks ul.social-share li#info-button:hover .info-tooltip {
    display: block;
}

/* Facebook share preview — light link-preview card (not a mystery dark box) */
.facebook-og-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    z-index: 13000;
    pointer-events: none;
    width: 360px;
    min-width: 360px;
    max-width: none;
    box-sizing: border-box;
    white-space: normal;
    overflow: visible;
    height: auto;
    line-height: normal;
    /* Kill theme borders/backgrounds that framed the old dark tooltip */
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

#social-bookmarks ul.social-share li#facebook-button:hover .facebook-og-tooltip,
#social-bookmarks ul.social-share li#facebook-button-on:hover .facebook-og-tooltip {
    display: block;
}

.facebook-og-tooltip__fb-icon {
    display: block;
    flex: 0 0 auto;
    color: #1877f2;
}

.facebook-og-tooltip__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    width: 100%;
    max-width: none;
    padding: 0;
    background: #fff !important;
    color: #050505;
    border: 0 !important;
    border-radius: 8px;
    box-sizing: border-box;
    text-align: left;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    white-space: normal;
    overflow: visible;
    height: auto;
    min-height: 0;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}

.facebook-og-tooltip__card::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 28px;
    border: 8px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
}

/* Label lives inside the card so page text never shows through */
.facebook-og-tooltip__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 12px;
    color: #050505;
    font-size: 12px;
    font-weight: 600;
    font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
    line-height: 1.2;
    background: #f0f2f5 !important;
    border: 0;
    border-bottom: 1px solid #e4e6eb;
    border-radius: 8px 8px 0 0;
}

.facebook-og-tooltip__content {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 0 0 8px 8px;
    background: #fff;
}

.facebook-og-tooltip__image {
    flex: 0 0 110px;
    max-width: none;
    background: #f0f2f5;
}

.facebook-og-tooltip__image img {
    display: block;
    width: 110px;
    max-width: none;
    height: 100%;
    min-height: 110px;
    object-fit: cover;
    border-radius: 0;
    opacity: 1 !important;
    filter: none !important;
}

.facebook-og-tooltip__body {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    padding: 12px 14px;
    overflow: visible;
    white-space: normal;
    max-width: none;
    background: #fff;
    border: 0;
}

.facebook-og-tooltip__domain {
    display: block;
    margin: 0 0 4px;
    color: #65676b;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.facebook-og-tooltip__title {
    display: block;
    color: #050505;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.35;
    margin: 0 0 4px;
    white-space: normal;
    overflow: hidden;
}

.facebook-og-tooltip__desc {
    display: -webkit-box;
    color: #65676b;
    font-size: 13px;
    line-height: 1.4;
    opacity: 1;
    white-space: normal;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.social-bookmarks-label {
    margin: 0 0 6px;
    font-weight: 600;
}
