/**
 * Social Profiles
 *
 * Sizing is driven by two custom properties set inline on the list:
 *   --wsk-sp-size  tile edge in px
 *   --wsk-sp-gap   space between tiles
 *   --wsk-sp-icon  glyph colour
 * and one per link:
 *   --wsk-sp-tile  tile background
 */

.wsk-social-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wsk-sp-gap, 8px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.wsk-social-profiles .wsk-sp-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wsk-social-profiles .wsk-sp-item::before,
.wsk-social-profiles .wsk-sp-item::marker {
    content: none;
}

.wsk-sp-align-center { justify-content: center; }
.wsk-sp-align-right  { justify-content: flex-end; }

.wsk-social-profiles .wsk-sp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: var(--wsk-sp-size, 40px);
    height: var(--wsk-sp-size, 40px);
    background: var(--wsk-sp-tile, #1f2937);
    color: var(--wsk-sp-icon, #fff);
    text-decoration: none;
    border: 0;
    box-shadow: none;
    transition: transform .15s ease, opacity .15s ease;
}

.wsk-social-profiles .wsk-sp-link:hover,
.wsk-social-profiles .wsk-sp-link:focus-visible {
    opacity: .85;
    transform: translateY(-2px);
    color: var(--wsk-sp-icon, #fff);
}

.wsk-social-profiles .wsk-sp-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Shapes */
.wsk-sp-square  .wsk-sp-link { border-radius: 0; }
.wsk-sp-rounded .wsk-sp-link { border-radius: 8px; }
.wsk-sp-circle  .wsk-sp-link { border-radius: 50%; }

.wsk-sp-plain .wsk-sp-link {
    background: none;
    color: var(--wsk-sp-tile, #1f2937);
    width: auto;
    height: auto;
}

/* Glyph */
.wsk-social-profiles .wsk-sp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 55%;
    height: 55%;
}

.wsk-sp-plain .wsk-sp-icon {
    width: calc(var(--wsk-sp-size, 40px) * .6);
    height: calc(var(--wsk-sp-size, 40px) * .6);
}

.wsk-social-profiles .wsk-sp-icon svg,
.wsk-social-profiles .wsk-sp-icon img {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Fallback lettermark for a network with no bundled icon */
.wsk-social-profiles .wsk-sp-letter {
    font-size: calc(var(--wsk-sp-size, 40px) * .45);
    font-weight: 700;
    line-height: 1;
    font-family: inherit;
}

/* Optional visible names */
.wsk-sp-labelled .wsk-sp-link {
    width: auto;
    min-width: var(--wsk-sp-size, 40px);
    padding: 0 14px 0 10px;
}

.wsk-sp-labelled .wsk-sp-icon {
    width: calc(var(--wsk-sp-size, 40px) * .5);
    height: calc(var(--wsk-sp-size, 40px) * .5);
    flex: none;
}

.wsk-social-profiles .wsk-sp-label {
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

/* Themes vary wildly in how they hide this; define our own so the accessible
   name is never visible but is still read out. */
.wsk-social-profiles .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .wsk-social-profiles .wsk-sp-link {
        transition: none;
    }
    .wsk-social-profiles .wsk-sp-link:hover,
    .wsk-social-profiles .wsk-sp-link:focus-visible {
        transform: none;
    }
}
