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

    This file contains rules for
    LINKS
    that implement the UU design system specifically for Sitevision

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


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

  Call-to-action with decorations
  Add styling to links and buttons

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

.call-to-action a::after {
    background-size: 1.3rem;
    background-repeat: no-repeat;
    content: " ";
    display: inline-block;
    height: 1.3rem;
    vertical-align: text-top;
    width: 1.3rem;
    margin-left: 0.5rem;
    background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNS4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjQgMjQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJLnN0MHtmaWxsOm5vbmU7fQ0KCS5zdDF7ZmlsbDojRkZGRkZGO30NCjwvc3R5bGU+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMCwwaDI0djI0SDBWMHoiLz4NCjxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0xMiw0bC0xLjQsMS40bDUuNiw1LjZINHYyaDEyLjJsLTUuNiw1LjZMMTIsMjBsOC04TDEyLDR6Ii8+DQo8L3N2Zz4NCg==);
}

.call-to-action a:not(.env-button) {
    color: var(--color-text);
}

.call-to-action a:not(.env-button)::after,
.env-button:not(.env-button--primary):not(:hover):not(:disabled):not(.disabled):not([aria-disabled=true])::after {
    filter: invert(1);
}

/* Remove arrow image when no text is entered in the puff */
.call-to-action-remove-arrow a::after {
    background-image: none;
}

/* Remove the reduced distance between two call-to-action elements to prevent shifting after page
   load */
.call-to-action + .call-to-action {
    margin-top: 0;
}

/* show link targets in print */
@media print {
    a:not([role="button"]):not([href="/"]):not([href="/en"])::after {
        -webkit-hyphenate-limit-after: 5;
        -webkit-hyphenate-limit-before: 4;
        background-image: none;
        content: " (" attr(href) ") ";
        display: inline-block;
        filter: none !important;
        hyphenate-limit-chars: 10 4 5;
        hyphens: auto;
        overflow-wrap: break-word;
        text-decoration: none;
        white-space: normal;
        width: auto;
        word-break: break-word;
    }

    .uu-block-link a:first-of-type::after {
        content: " (" attr(href) ") " !important;
        position: static !important;
    }

    a.d-flex {
        display: inline-block !important;
    }
}


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

 Link groups

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

/* Remove margin from link group */
.link-group {
    gap: 0;
    margin-bottom: calc(0px - var(--env-spacing-xx-small));
}

/* But add margin to link group items */
.link-group-item {
    margin: 0 var(--env-spacing-xx-small) var(--env-spacing-xx-small) 0;
}

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

 Link groups in webapp-tag

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

/* If no tags are selected we must ensure this module is not visible and take up space */
.sv-se-uu-uit-webb-webapp-tag {
    margin-bottom: 0 !important;
}

/* However, if tags are selected we must ensure it gets the correct margin. 1.5rem is the normal
   margin for a custom module and a negative xx small margin is standard for a link group. */
.sv-se-uu-uit-webb-webapp-tag .link-group {
    margin-bottom: calc(1.5rem - var(--env-spacing-xx-small));
}

/* This is a temporary fix for the link group items that has icons. This should be fixed in the UU
   design system. */
.sv-se-uu-uit-webb-webapp-tag .link-group-item.icon-position-left {
    align-items: center;
    display: flex;
    text-align: left;
}