/**
 * Cybersalt Article Actions - action bar
 *
 * @copyright   (C) 2026 Cybersalt. All rights reserved.
 * @license     GNU General Public License version 2 or later
 *
 * Every look-and-feel value is a custom property, so the Styling tab and the
 * Custom CSS box only need to set variables:
 *   --csaa-size   button height (and width when icon-only)
 *   --csaa-gap    space between buttons
 *   --csaa-mono   button colour in single-colour mode
 *   --csaa-fg     icon and label colour
 *
 * Brand colours are darkened where needed so a white icon or label clears
 * WCAG AA (4.5:1) on every one of them.
 */

.csaa {
    --csaa-size: 30px;
    --csaa-gap: 6px;
    --csaa-fg: #fff;
    --csaa-radius: 50%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--csaa-gap);
    margin: 0.5rem 0 1rem;
    clear: both;
}

.csaa--rounded { --csaa-radius: 6px; }
.csaa--square { --csaa-radius: 0; }

.csaa--align-center { justify-content: center; }
.csaa--align-end { justify-content: flex-end; }

.csaa__intro {
    font-size: 0.875rem;
    margin-inline-end: 0.15rem;
}

.csaa .csaa__btn,
.csaa .csaa__btn:link,
.csaa .csaa__btn:visited,
.csaa .csaa__btn:hover,
.csaa .csaa__btn:focus,
.csaa .csaa__btn:active {
    color: var(--csaa-fg);
    text-decoration: none;
}

.csaa .csaa__btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    min-width: var(--csaa-size);
    height: var(--csaa-size);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--csaa-radius);
    background: var(--csaa-bg, #4b5563);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.csaa .csaa__btn[hidden] { display: none; }

.csaa .csaa__btn:hover {
    filter: brightness(0.85);
    transform: translateY(-1px);
}

.csaa .csaa__btn:focus-visible {
    outline: 2px solid #1a56db;
    outline-offset: 2px;
}

.csaa .csaa__icon {
    flex: none;
    width: calc(var(--csaa-size) * 0.55);
    height: calc(var(--csaa-size) * 0.55);
    fill: currentColor;
}

.csaa__btn--print { --csaa-bg: #4b5563; }
.csaa__btn--email { --csaa-bg: #0e7490; }
.csaa__btn--facebook { --csaa-bg: #0866ff; }
.csaa__btn--x { --csaa-bg: #000; }
.csaa__btn--linkedin { --csaa-bg: #0a66c2; }
.csaa__btn--share { --csaa-bg: #15803d; }

.csaa--mono .csaa__btn { --csaa-bg: var(--csaa-mono, #4b5563); }

/* Icon-only by default: the label stays for screen readers. */
.csaa:not(.csaa--labels) .csaa__label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.csaa--labels .csaa__btn {
    padding: 0 0.8em 0 0.55em;
}

.csaa--labels:not(.csaa--rounded):not(.csaa--square) .csaa__btn {
    border-radius: calc(var(--csaa-size) / 2);
}

@media (prefers-reduced-motion: reduce) {
    .csaa .csaa__btn { transition: none; }
    .csaa .csaa__btn:hover { transform: none; }
}

@media print {
    .csaa { display: none !important; }
}
