/* Social Media Links component
   Where the site is on social media, shown on a page. The addresses come from
   Settings, Social Media; presentation comes from the settings resolved in
   _SocialMediaLinks_Base.cshtml.

   Two templates share this file:
     .social-links--list   ContactList, a row per platform naming it
     .social-links--row    IconRow, the marks in a line

   Four styles, each meaning the same thing in both templates:
     plain     nothing behind the mark
     bordered  a line around it
     filled    a tinted ground behind it
     brand     the platform's own color

   The marks are Bootstrap Icons, so they take the color of the text around
   them. Everything below is chrome around that. */

.social-links {
    margin-bottom: 1.5rem;
}

.social-links__header {
    margin-bottom: 1.25rem;
}

.social-links--align-center .social-links__header {
    text-align: center;
}

.social-links__eyebrow {
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
}

.social-links__title {
    margin-bottom: 0.5rem;
}

.social-links__intro > :last-child {
    margin-bottom: 0;
}

.social-links__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.social-links__link {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

/* The mark itself. A fixed box in both templates, so a circle is a circle and
   a row of them lines up whatever glyph each platform uses. */
.social-links__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.social-links__name {
    font-weight: 600;
}

.social-links__note {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.7;
}

/* Mark size ---------------------------------------------------------------
   One pair of numbers per size: the glyph, and the box it sits in. */
.social-links--size-small {
    --social-glyph: 1rem;
    --social-box: 2.25rem;
}

.social-links--size-medium {
    --social-glyph: 1.375rem;
    --social-box: 3rem;
}

.social-links--size-large {
    --social-glyph: 1.875rem;
    --social-box: 4rem;
}

.social-links__mark {
    width: var(--social-box);
    height: var(--social-box);
    font-size: var(--social-glyph);
}

/* ContactList -------------------------------------------------------------
   A stacked list, each row naming its platform. The legacy site's look. */

.social-links--list .social-links__link {
    gap: 1rem;
    padding: 0.875rem 1.25rem;
}

.social-links--list.social-links--align-center .social-links__link {
    /* Centred as a block, so the rows still line up with each other rather
       than each one centring its own text. */
    justify-content: center;
}

.social-links--list .social-links__body {
    min-width: 0;
}

/* Boxed: rows sharing their borders, so the stack reads as one object. */
.social-links--list.social-links--style-bordered .social-links__item + .social-links__item {
    margin-top: -1px;
}

.social-links--list.social-links--style-bordered .social-links__link {
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.social-links--list.social-links--style-bordered .social-links__link:hover,
.social-links--list.social-links--style-bordered .social-links__link:focus {
    background-color: rgba(var(--bs-primary-rgb), .06);
    /* Lifted above its neighbours so the shared border is this row's. */
    position: relative;
    z-index: 1;
}

.social-links--list.social-links--style-filled .social-links__item + .social-links__item {
    margin-top: 0.5rem;
}

.social-links--list.social-links--style-filled .social-links__link {
    border-radius: 0.5rem;
    background-color: var(--bs-tertiary-bg, #f8f9fa);
}

.social-links--list.social-links--style-filled .social-links__link:hover,
.social-links--list.social-links--style-filled .social-links__link:focus {
    background-color: rgba(var(--bs-primary-rgb), .1);
}

.social-links--list.social-links--style-plain .social-links__link,
.social-links--list.social-links--style-brand .social-links__link {
    padding-inline: 0;
}

.social-links--list.social-links--style-plain .social-links__link:hover .social-links__name,
.social-links--list.social-links--style-plain .social-links__link:focus .social-links__name {
    text-decoration: underline;
}

/* IconRow -----------------------------------------------------------------
   The marks in a line, wrapping on a narrow screen. */

.social-links--row .social-links__items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links--row.social-links--align-center .social-links__items {
    justify-content: center;
}

.social-links--row .social-links__link {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.social-links--row .social-links__name {
    font-size: 0.8125rem;
    font-weight: 500;
}

.social-links--row .social-links__mark {
    border-radius: 50%;
}

.social-links--row.social-links--style-bordered .social-links__mark {
    border: 1px solid currentColor;
    opacity: 0.85;
}

.social-links--row.social-links--style-bordered .social-links__link:hover .social-links__mark,
.social-links--row.social-links--style-bordered .social-links__link:focus .social-links__mark {
    opacity: 1;
    transform: translateY(-2px);
}

.social-links--row.social-links--style-filled .social-links__mark {
    background-color: rgba(var(--bs-primary-rgb), .1);
    color: rgba(var(--bs-primary-rgb), 1);
}

.social-links--row.social-links--style-filled .social-links__link:hover .social-links__mark,
.social-links--row.social-links--style-filled .social-links__link:focus .social-links__mark {
    background-color: rgba(var(--bs-primary-rgb), 1);
    color: #fff;
    transform: translateY(-2px);
}

.social-links--row.social-links--style-plain .social-links__link:hover .social-links__mark,
.social-links--row.social-links--style-plain .social-links__link:focus .social-links__mark {
    transform: translateY(-2px);
    opacity: 0.75;
}

/* Brand colors ------------------------------------------------------------
   The one place this file knows a platform by name. The renderer puts the key
   on the item and nothing else here depends on which platforms exist: a
   platform with no rule below simply keeps the text color, which is what every
   other style uses anyway.

   In a row the color fills the mark, which is how each of these platforms
   draws itself. In a list it colors the glyph, because a column of filled
   circles beside plain rows reads as decoration rather than as links. */

.social-links--style-brand .social-links__item--facebook { --social-brand: #1877f2; }
.social-links--style-brand .social-links__item--instagram { --social-brand: #e4405f; }
.social-links--style-brand .social-links__item--youtube { --social-brand: #ff0000; }
.social-links--style-brand .social-links__item--x { --social-brand: #000000; }
.social-links--style-brand .social-links__item--linkedin { --social-brand: #0a66c2; }
.social-links--style-brand .social-links__item--tiktok { --social-brand: #010101; }

.social-links--row.social-links--style-brand .social-links__mark {
    background-color: var(--social-brand, currentColor);
    color: #fff;
}

.social-links--row.social-links--style-brand .social-links__link:hover .social-links__mark,
.social-links--row.social-links--style-brand .social-links__link:focus .social-links__mark {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.social-links--list.social-links--style-brand .social-links__mark {
    color: var(--social-brand, currentColor);
}

.social-links--list.social-links--style-brand .social-links__link:hover .social-links__name,
.social-links--list.social-links--style-brand .social-links__link:focus .social-links__name {
    color: var(--social-brand, currentColor);
}

/* A black mark on a dark section is not a mark. Both platforms that draw
   themselves in black get a ring instead, which is what they do themselves on
   dark grounds. */
[data-bs-theme="dark"] .social-links--row.social-links--style-brand .social-links__item--x .social-links__mark,
[data-bs-theme="dark"] .social-links--row.social-links--style-brand .social-links__item--tiktok .social-links__mark {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

[data-bs-theme="dark"] .social-links--list.social-links--style-brand .social-links__item--x,
[data-bs-theme="dark"] .social-links--list.social-links--style-brand .social-links__item--tiktok {
    --social-brand: #fff;
}

/* A component keeps the site's band when the page runs edge to edge: these are
   words and links, not a photograph. */
.page-full .social-links {
    max-width: var(--cms-band);
    margin-inline: auto;
    padding-inline: 0.75rem;
    /* A promo band above is a flush stripe here (hero.css), with no margin
       to lend, so the room above is this section's own; below, the page's
       foot and the footer already give about as much. */
    padding-top: 4rem;
    margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
    .social-links__mark {
        transition: none;
    }

    .social-links__link:hover .social-links__mark,
    .social-links__link:focus .social-links__mark {
        transform: none;
    }
}
