/*
 * Styles for the Custom Share Buttons plugin.
 *
 * These rules scope all selectors within the `.csb-share-buttons` namespace to
 * avoid collisions with your theme.  The toolbar uses CSS custom properties
 * to control the colour palette; adjust the defaults below to fine tune the
 * appearance.  The colour palette roughly matches the bold red accents used
 * throughout the Trevor Decker News theme.  A dark‑mode media query
 * overrides the text colour for better contrast in dark themes.
 */

:root {
    --csb-color-text: #222222;        /* Colour for the "Share:" label */
    --csb-color-primary: #c8102e;      /* Primary red used for icon backgrounds */
    --csb-color-primary-hover: #9e0b1d; /* Darker shade for hover/active state */
    --csb-color-contrast: #ffffff;      /* Colour for the icon glyphs */
    --csb-bar-background: #f7f7f7;      /* Light grey background for the share bar */
}

/* Layout for the share bar itself */
.csb-share-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0.5rem 0.75rem;
    background-color: var(--csb-bar-background);
    border-radius: 6px;
}

.csb-share-buttons .csb-share-label {
    margin-right: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    /* Use the primary accent colour for the “Share:” label to ensure clear
       contrast on both light and dark backgrounds.  This also ties into the
       theme’s red accent used for icons and borders. */
    color: var(--csb-color-primary);
}

/* Generic button styling */
/* Buttons are rectangular with a subtle border.  They invert colours on hover */
.csb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--csb-color-primary);
    background-color: #ffffff;
    color: var(--csb-color-primary);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Icons adjust to fit within the smaller rectangular buttons */
.csb-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Hover state: fill the button with red and swap icon to white */
.csb-button:hover,
.csb-button:focus {
    background-color: var(--csb-color-primary);
    color: var(--csb-color-contrast);
    transform: translateY(-1px);
}

/* Visually indicate a successful copy action by reusing the hover colours */
.csb-button.csb-copied {
    background-color: var(--csb-color-primary);
    color: var(--csb-color-contrast);
}

/* Extra spacing for the bottom toolbar */
.csb-share-buttons.csb-context-bottom {
    margin-top: 2rem;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --csb-color-text: #e5e5e5;
        /* keep primary colours the same to retain brand recognition */
    }
    .csb-share-buttons.csb-context-bottom {
        border-top-color: #444444;
    }
}