/************************************************

Components, loaded on every page: the animated underline and the buttons.

*************************************************/

/* ---------- ANIMATED UNDERLINE ----------
.u-underline           the text that gets the line; hovering it starts the line
.u-underline-trigger   a parent (a card, a link with an icon) that starts the
                       line of the .u-underline inside it

On hover the line grows from left to right and stays; on hover out it shrinks
towards the right. The line is a background in the text colour, anchored left
while hovered and right otherwise. Only its width is animated, so the anchor
switches instantly. Works on inline text that wraps over several lines. */
.u-underline {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 100% 100%;
    background-size: 0% 1px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background-size .35s ease, color .2s ease;
}

.u-underline:hover,
.u-underline:focus-visible,
.u-underline-trigger:hover .u-underline,
.u-underline-trigger:focus-visible .u-underline {
    background-position: 0 100%;
    background-size: 100% 1px;
}

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

/* ---------- BUTTONS ----------
.btn           base: pill, uppercase label, optional icon
.btn--dark     dark green, turns gold on hover
.btn--gold     gold with dark text, turns dark green on hover
.btn--outline  transparent with a dark green ring, fills dark green on hover
.btn--icon     round icon-only button (36px), for example the newsletter arrow
.btn__arrow    an icon inside a button that moves right on hover
.text-link     a text link in button lettering, permanently underlined

<a href="..." class="btn btn--dark">Maak een afspraak <svg class="btn__arrow">...</svg></a>

The element is part of the base selector ("a.btn", "button.btn") so it
outweighs the global theme rules on "a" (font-size, letter-spacing, colour,
a bouncy "all" transition) and the scoped resets like ".sf-cta *". */
a.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 16px 24px;
    border: none;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.btn .btn__arrow {
    flex-shrink: 0;
    transition: transform .25s ease, color .25s ease;
}

.btn:hover .btn__arrow,
.btn:focus-visible .btn__arrow {
    transform: translateX(4px);
}

.btn:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 3px;
}

/* dark */
.btn.btn--dark {
    background: var(--color-green);
    color: var(--color-bg);
}

.btn.btn--dark .btn__arrow {
    color: var(--color-gold);
}

.btn.btn--dark:hover,
.btn.btn--dark:focus-visible {
    background: var(--color-gold);
    color: var(--color-green);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(3, 23, 6, .14);
}

.btn.btn--dark:hover .btn__arrow,
.btn.btn--dark:focus-visible .btn__arrow {
    color: var(--color-green);
}

/* gold */
.btn.btn--gold {
    background: var(--color-gold);
    color: var(--color-green);
}

.btn.btn--gold:hover,
.btn.btn--gold:focus-visible {
    background: var(--color-green);
    color: var(--color-bg);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(3, 23, 6, .14);
}

/* outline: same size, inverted; fills dark green on hover */
.btn.btn--outline {
    background: transparent;
    color: var(--color-green);
    box-shadow: inset 0 0 0 1px var(--color-green);
}

.btn.btn--outline .btn__arrow {
    color: var(--color-gold);
}

.btn.btn--outline:hover,
.btn.btn--outline:focus-visible {
    background: var(--color-green);
    color: var(--color-bg);
    transform: translateY(-2px);
}

.btn.btn--dark:active,
.btn.btn--gold:active,
.btn.btn--outline:active {
    transform: translateY(0);
    box-shadow: none;
}

/* round icon-only */
.btn.btn--icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    gap: 0;
    padding: 0;
    border-radius: 50%;
    background: var(--color-gold);
    color: var(--color-green);
}

.btn.btn--icon:hover,
.btn.btn--icon:focus-visible {
    background: var(--color-bg);
    transform: scale(1.06);
}

.btn.btn--icon:hover .btn__arrow,
.btn.btn--icon:focus-visible .btn__arrow {
    transform: translateX(2px);
}

.btn.btn--icon:active {
    transform: scale(.96);
}

/* text link in button lettering, permanently underlined */
a.text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 4px;
    color: var(--color-green);
    transition: color .2s ease;
}

a.text-link:hover,
a.text-link:focus-visible {
    color: var(--color-gold-icon);
}

/* disabled, for example while a form is sending */
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: .5;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.btn.btn--icon:disabled {
    background: var(--color-gold);
}

.btn:disabled .btn__arrow {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    a.btn,
    button.btn,
    .btn .btn__arrow {
        transition: none;
    }

    .btn.btn--dark:hover,
    .btn.btn--dark:focus-visible,
    .btn.btn--gold:hover,
    .btn.btn--gold:focus-visible,
    .btn.btn--outline:hover,
    .btn.btn--outline:focus-visible,
    .btn.btn--icon:hover,
    .btn.btn--icon:focus-visible,
    .btn.btn--icon:active,
    .btn.btn:hover .btn__arrow,
    .btn.btn:focus-visible .btn__arrow {
        transform: none;
    }
}
