/* =========================================================
 * RankwellPress — Share Buttons (Perfect Horizontal Alignment)
 * ========================================================= */

.rwp-share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    line-height: 1;
}

.rwp-share-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--rw-text-heading, #111827);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 42px; /* Matched to new button height */
    display: inline-flex;
    align-items: center;
    height: 42px;      /* Matched to new button height */
    margin: 0;
    padding: 0;
}

.rwp-share-icons {
    display: flex;
    align-items: center;
    gap: 8px;          /* Slightly wider gap for bigger buttons */
    flex-wrap: nowrap;
    position: relative;
    flex-shrink: 1;
    min-width: 0;
    line-height: 1;
    overflow: visible;
    margin: 0;
    padding: 0;
}

.rwp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;       /* Increased from 34px */
    height: 42px;      /* Increased from 34px */
    min-width: 42px;
    min-height: 42px;
    border-radius: 8px;
    color: #ffffff;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.rwp-share-btn svg {
    width: 20px;       /* Increased from 16px */
    height: 20px;      /* Increased from 16px */
    display: block;
    flex-shrink: 0;
}

/* Hover states */
.rwp-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--rw-shadow-md, 0 4px 12px rgba(0,0,0,0.15));
    opacity: 0.9;
}

.rwp-share-btn:focus-visible {
    outline: 2px solid var(--rw-color-primary, #0d7c3e);
    outline-offset: 3px;
}

.rwp-share-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* =========================================================
 * Brand Colors — All Platforms
 * ========================================================= */

/* Primary */
.rwp-share-facebook  { background-color: #1877F2; }
.rwp-share-twitter   { background-color: #000000; }
.rwp-share-whatsapp  { background-color: #25D366; }
.rwp-share-linkedin  { background-color: #0A66C2; }
.rwp-share-telegram  { background-color: #0088cc; }

/* Secondary — Extended */
.rwp-share-instagram  { background-color: #E1306C; }
.rwp-share-tiktok     { background-color: #000000; }
.rwp-share-threads    { background-color: #000000; }
.rwp-share-lekeelekee { background-color: #FF6B00; }
.rwp-share-reddit     { background-color: #FF4500; }
.rwp-share-pinterest  { background-color: #BD081C; }
.rwp-share-email      { background-color: #6B7280; }
.rwp-share-copy       { background-color: #6B7280; }

/* New Platforms */
.rwp-share-bluesky   { background-color: #0560FF; }
.rwp-share-mastodon  { background-color: #6364FF; }
.rwp-share-flipboard { background-color: #E12828; }
.rwp-share-tumblr    { background-color: #36465D; }
.rwp-share-pocket    { background-color: #EF4056; }
.rwp-share-line      { background-color: #00C300; }
.rwp-share-viber     { background-color: #7360F2; }
.rwp-share-vk        { background-color: #0077FF; }
.rwp-share-digg      { background-color: #000000; }
.rwp-share-mix       { background-color: #FF8226; }

/* More button */
.rwp-share-more {
    background-color: var(--rw-bg-alt, #f3f4f6);
    color: var(--rw-text-body, #4b5563);
    border: none;
    cursor: pointer;
}

.rwp-share-more:hover {
    background-color: var(--rw-text-muted, #6b7280);
    color: #ffffff;
}

/* Dropdown */
.rwp-share-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--rw-bg-content, #ffffff);
    border: 1px solid var(--rw-border-light, #e5e7eb);
    border-radius: var(--rw-radius-md, 8px);
    box-shadow: var(--rw-shadow-hover, 0 8px 24px rgba(0,0,0,0.12));
    padding: 8px;
    z-index: 1000;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}

.rwp-share-dropdown.active {
    display: flex;
}

.rwp-share-extended-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--rw-text-body, #4b5563);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    line-height: 1.4;
    box-sizing: border-box;
}

.rwp-share-extended-btn:hover {
    background-color: var(--rw-bg-alt, #f3f4f6);
}

.rwp-share-extended-btn:focus-visible {
    outline: 2px solid var(--rw-color-primary, #0d7c3e);
    outline-offset: -2px;
}

.share-dropdown-text {
    white-space: nowrap;
}

/* Dropdown scrollbar */
.rwp-share-dropdown::-webkit-scrollbar {
    width: 4px;
}

.rwp-share-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.rwp-share-dropdown::-webkit-scrollbar-thumb {
    background: var(--rw-border-light, #e5e7eb);
    border-radius: 2px;
}

/* Dark Mode */
html[data-theme="dark"] .rwp-share-label {
    color: var(--rw-text-heading, #f3f4f6);
}

html[data-theme="dark"] .rwp-share-more {
    background-color: #2d2d2d;
    color: #d1d5db;
}

html[data-theme="dark"] .rwp-share-more:hover {
    background-color: #404040;
    color: #ffffff;
}

html[data-theme="dark"] .rwp-share-dropdown {
    background: #1a1a1a;
    border-color: #404040;
}

html[data-theme="dark"] .rwp-share-extended-btn {
    color: #d1d5db;
}

html[data-theme="dark"] .rwp-share-extended-btn:hover {
    background-color: #2d2d2d;
}

html[data-theme="dark"] .rwp-share-dropdown::-webkit-scrollbar-thumb {
    background: #404040;
}

/* Mobile */
@media (max-width: 480px) {
    .rwp-share-buttons {
        gap: 6px;
    }
    
    .rwp-share-label {
        font-size: 0.7rem;
        letter-spacing: 0.3px;
        line-height: 36px; /* Matched to mobile button height */
        height: 36px;      /* Matched to mobile button height */
    }
    
    .rwp-share-icons {
        gap: 5px;
    }
    
    .rwp-share-btn {
        width: 36px;       /* Increased from 30px */
        height: 36px;      /* Increased from 30px */
        min-width: 36px;
        min-height: 36px;
        border-radius: 6px;
    }
    
    .rwp-share-btn svg {
        width: 16px;       /* Increased from 14px */
        height: 16px;      /* Increased from 14px */
    }
    
    .rwp-share-dropdown {
        min-width: 180px;
        max-height: 280px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .rwp-share-btn,
    .rwp-share-extended-btn {
        transition: none !important;
    }
    
    .rwp-share-btn:hover,
    .rwp-share-btn:active {
        transform: none !important;
    }
}


/* =========================================================
 * FONT ADJUSTER — inline in the top share bar
 * Compact pill: [A-  A+]
 * ========================================================= */

.rwp-share-font-adjuster {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 8px;
    height: 42px; /* Matched to new button height */
}

.rwp-share-font-adjuster .rwp-font-adjuster {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    margin: 0;
    background: var(--rw-bg-alt, #f3f4f6);
    border: 1px solid var(--rw-border-light, #e5e7eb);
    border-radius: 100px;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    height: 34px; /* Slightly taller to match new scale */
}

/* A- / A+ buttons */
.rwp-share-font-adjuster .font-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--rw-text-body, #4b5563);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
    line-height: 1;
}

.rwp-share-font-adjuster .font-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
    color: var(--rw-color-primary, #0d7c3e);
}

.rwp-share-font-adjuster .font-btn:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
}

.rwp-share-font-adjuster .font-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.rwp-share-font-adjuster .font-btn:focus-visible {
    outline: 2px solid var(--rw-color-primary, #0d7c3e);
    outline-offset: 1px;
}

.rwp-share-font-adjuster .font-btn-icon {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    display: inline-block;
}

/* Hide any leftover markup from old font adjuster versions */
.rwp-share-font-adjuster .font-adjuster-label,
.rwp-share-font-adjuster .font-size-indicator,
.rwp-share-font-adjuster .font-reset {
    display: none !important;
}

/* Never show the font adjuster on the bottom share bar */
.rwp-share-location-bottom .rwp-share-font-adjuster,
.rwp-share-location-default .rwp-share-font-adjuster {
    display: none !important;
}

/* Small screens */
@media (max-width: 480px) {
    .rwp-share-font-adjuster {
        padding-left: 4px;
        height: 36px;
    }

    .rwp-share-font-adjuster .rwp-font-adjuster {
        padding: 2px 4px;
        gap: 1px;
        height: 30px;
    }

    .rwp-share-font-adjuster .font-btn {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }

    .rwp-share-font-adjuster .font-btn-icon {
        font-size: 0.7rem;
    }
}

/* Dark mode */
html[data-theme="dark"] .rwp-share-font-adjuster .rwp-font-adjuster {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .rwp-share-font-adjuster .font-btn {
    color: #e5e7eb;
}

html[data-theme="dark"] .rwp-share-font-adjuster .font-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rw-color-primary, #0d7c3e);
}


/* Clear separation between the "..." button and the font adjuster */
.rwp-share-icons {
    padding-right: 8px;
}

.rwp-share-font-adjuster {
    padding-left: 8px;
    border-left: 1px solid var(--rw-border-light, #e5e7eb);
}


/* =========================================================
 * LINK COLOR IMMUNITY — protects share buttons from
 * global article link rules (.post-content a:link, etc.)
 *
 * All content link rules use specificity (0,2,1). This block
 * uses (0,4,2) + !important so nothing can override it.
 * ========================================================= */

/* Kill link colors, underline, and any external-link arrow
   on every share button in every state. */
.rwp-share-btn,
.rwp-share-btn:link,
.rwp-share-btn:visited,
.rwp-share-btn:hover,
.rwp-share-btn:focus,
.rwp-share-btn:focus-visible,
.rwp-share-btn:active,
.post-content .rwp-share-btn,
.post-content .rwp-share-btn:link,
.post-content .rwp-share-btn:visited,
.post-content .rwp-share-btn:hover,
.post-content .rwp-share-btn:focus,
.post-content .rwp-share-btn:focus-visible,
.post-content .rwp-share-btn:active,
.entry-content .rwp-share-btn,
.entry-content .rwp-share-btn:link,
.entry-content .rwp-share-btn:visited,
.entry-content .rwp-share-btn:hover,
.single-content .rwp-share-btn,
.single-content .rwp-share-btn:link,
.single-content .rwp-share-btn:visited,
.rwp-article-body .rwp-share-btn,
.rwp-article-body .rwp-share-btn:link,
.rwp-article-body .rwp-share-btn:visited {
    color: #ffffff !important;
    text-decoration: none !important;
    text-decoration-color: transparent !important;
    text-decoration-line: none !important;
    text-underline-offset: 0 !important;
    background-image: none !important;
}

/* Kill the ↗ external-link arrow if the link has target="_blank" */
.rwp-share-btn[target="_blank"]::after,
.post-content .rwp-share-btn[target="_blank"]::after,
.entry-content .rwp-share-btn[target="_blank"]::after,
.single-content .rwp-share-btn[target="_blank"]::after,
.rwp-article-body .rwp-share-btn[target="_blank"]::after {
    content: none !important;
    display: none !important;
}

/* Lock in platform brand backgrounds — with !important so
   nothing can override them either */
.rwp-share-btn.rwp-share-facebook,
.post-content .rwp-share-btn.rwp-share-facebook,
.entry-content .rwp-share-btn.rwp-share-facebook {
    background-color: var(--rw-brand-facebook, #1877F2) !important;
}

.rwp-share-btn.rwp-share-twitter,
.rwp-share-btn.rwp-share-x,
.post-content .rwp-share-btn.rwp-share-twitter,
.post-content .rwp-share-btn.rwp-share-x {
    background-color: var(--rw-brand-twitter, #000000) !important;
}

.rwp-share-btn.rwp-share-whatsapp,
.post-content .rwp-share-btn.rwp-share-whatsapp {
    background-color: var(--rw-brand-whatsapp, #25D366) !important;
}

.rwp-share-btn.rwp-share-linkedin,
.post-content .rwp-share-btn.rwp-share-linkedin {
    background-color: var(--rw-brand-linkedin, #0A66C2) !important;
}

.rwp-share-btn.rwp-share-telegram,
.post-content .rwp-share-btn.rwp-share-telegram {
    background-color: var(--rw-brand-telegram, #0088cc) !important;
}

.rwp-share-btn.rwp-share-instagram,
.post-content .rwp-share-btn.rwp-share-instagram {
    background-color: var(--rw-brand-instagram, #E1306C) !important;
}

.rwp-share-btn.rwp-share-youtube,
.post-content .rwp-share-btn.rwp-share-youtube {
    background-color: var(--rw-brand-youtube, #FF0000) !important;
}

.rwp-share-btn.rwp-share-reddit,
.post-content .rwp-share-btn.rwp-share-reddit {
    background-color: #FF4500 !important;
}

.rwp-share-btn.rwp-share-pinterest,
.post-content .rwp-share-btn.rwp-share-pinterest {
    background-color: #BD081C !important;
}

.rwp-share-btn.rwp-share-email,
.post-content .rwp-share-btn.rwp-share-email {
    background-color: #6B7280 !important;
}

.rwp-share-btn.rwp-share-copy,
.post-content .rwp-share-btn.rwp-share-copy {
    background-color: #6B7280 !important;
}

/* The "..." more button stays neutral, even inside content */
.rwp-share-more,
.post-content .rwp-share-more,
.entry-content .rwp-share-more {
    background-color: var(--rw-bg-alt, #f3f4f6) !important;
    color: var(--rw-text-body, #4b5563) !important;
}

.rwp-share-more:hover,
.post-content .rwp-share-more:hover {
    background-color: var(--rw-text-muted, #6b7280) !important;
    color: #ffffff !important;
}

/* Extended buttons inside dropdown — no underline, no link color */
.rwp-share-extended-btn,
.rwp-share-extended-btn:link,
.rwp-share-extended-btn:visited,
.rwp-share-extended-btn:hover,
.rwp-share-extended-btn:focus,
.post-content .rwp-share-extended-btn,
.post-content .rwp-share-extended-btn:link,
.post-content .rwp-share-extended-btn:visited,
.post-content .rwp-share-extended-btn:hover {
    color: var(--rw-text-body, #4b5563) !important;
    text-decoration: none !important;
    text-decoration-line: none !important;
    background-image: none !important;
}

/* Dark mode — same protections */
html[data-theme="dark"] .rwp-share-btn,
html[data-theme="dark"] .rwp-share-btn:link,
html[data-theme="dark"] .rwp-share-btn:visited,
html[data-theme="dark"] .post-content .rwp-share-btn,
html[data-theme="dark"] .post-content .rwp-share-btn:link,
html[data-theme="dark"] .post-content .rwp-share-btn:visited {
    color: #ffffff !important;
    text-decoration: none !important;
}

html[data-theme="dark"] .rwp-share-more,
html[data-theme="dark"] .post-content .rwp-share-more {
    background-color: #2d2d2d !important;
    color: #d1d5db !important;
}

html[data-theme="dark"] .rwp-share-more:hover,
html[data-theme="dark"] .post-content .rwp-share-more:hover {
    background-color: #404040 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .rwp-share-extended-btn,
html[data-theme="dark"] .rwp-share-extended-btn:link,
html[data-theme="dark"] .rwp-share-extended-btn:visited {
    color: #d1d5db !important;
    text-decoration: none !important;
}