/*
 * Base styles for the linktree. Selectors are class based, so they win over
 * element resets (e.g. Bootstrap reboot) while fonts and colors are inherited
 * from the website. Adjust the look via the custom properties below or enter
 * the website's button classes (e.g. "btn btn-primary") in the backend.
 */
.linktree {
    --linktree-max-width: 36rem;
    --linktree-gap: 1.5rem;
    --linktree-image-size: 8rem;
    --linktree-image-max-height: 8rem;
    --linktree-link-gap: 1rem;
    --linktree-links-spacing: 1rem;
    --linktree-link-min-height: 3.5rem;
    --linktree-link-radius: 999px;
    --linktree-link-bg: #fff;
    --linktree-link-color: #1d1d1f;
    --linktree-link-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
    --linktree-icon-size: 1.75rem;
    --linktree-arrow-size: 0.75em;
    --linktree-arrow-weight: 2.75;

    box-sizing: border-box;
    width: 100%;
    padding: 2.5rem 1rem;
}

.linktree__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--linktree-gap);
    max-width: var(--linktree-max-width);
    margin-inline: auto;
    text-align: center;
}

.linktree__profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.linktree__image {
    margin: 0 0 0.5rem;
}

.linktree__image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.linktree__image--circle img {
    width: var(--linktree-image-size);
    height: var(--linktree-image-size);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
}

.linktree__image--original img {
    width: auto;
    max-height: var(--linktree-image-max-height);
}

.linktree__headline {
    margin: 0;
}

.linktree__description {
    margin: 0;
}

.linktree__links,
.linktree__socials {
    margin: 0;
    padding: 0;
    list-style: none;
}

.linktree__links {
    display: flex;
    flex-direction: column;
    gap: var(--linktree-link-gap);
    width: 100%;
    margin-block: var(--linktree-links-spacing);
}

.linktree__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    box-sizing: border-box;
    width: 100%;
}

.linktree__arrow {
    flex-shrink: 0;
    width: var(--linktree-arrow-size);
    height: var(--linktree-arrow-size);
    fill: none;
    stroke: currentColor;
    stroke-width: var(--linktree-arrow-weight);
    transition: transform 0.15s ease-out;
}

.linktree__link:is(:hover, :focus-visible) .linktree__arrow {
    transform: translateX(0.25em);
}

/* Default button look, skipped as soon as website button classes are configured */
.linktree:not(.linktree--custom-buttons) .linktree__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--linktree-link-min-height);
    padding: 0.75rem 1.5rem;
    border-radius: var(--linktree-link-radius);
    background: var(--linktree-link-bg);
    box-shadow: var(--linktree-link-shadow);
    color: var(--linktree-link-color);
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: transform 0.15s ease-out;
}

.linktree:not(.linktree--custom-buttons) .linktree__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.linktree__socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.linktree__social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s ease-out;
}

.linktree__social:hover {
    opacity: 0.7;
}

.linktree__icon {
    width: var(--linktree-icon-size);
    height: var(--linktree-icon-size);
    fill: currentColor;
}

/* Colors chosen in the backend; only active when set, otherwise the website styles apply */
.linktree--has-bg {
    background-color: var(--linktree-bg);
}

.linktree--has-headline-color .linktree__headline {
    color: var(--linktree-headline-color);
}

.linktree--has-description-color .linktree__description {
    color: var(--linktree-description-color);
}

.linktree--has-link-bg .linktree__link,
.linktree--has-link-bg .linktree__link:is(:hover, :focus-visible, :active) {
    border-color: var(--linktree-link-bg);
    background-color: var(--linktree-link-bg);
}

.linktree--has-link-color .linktree__link,
.linktree--has-link-color .linktree__link:is(:hover, :focus-visible, :active) {
    color: var(--linktree-link-color);
}

.linktree--has-social-color .linktree__social {
    color: var(--linktree-social-color);
}

@media (prefers-reduced-motion: reduce) {
    .linktree__link,
    .linktree__arrow,
    .linktree__social {
        transition: none;
    }
}

@media (min-width: 48em) {
    .linktree {
        padding-block: 4rem;
    }
}
