/* @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap'); */

.procydo-portal {
    #systemMessage, #page-content {
        --ic-font-base: "Open Sans", Verdana, Arial, Helvetica, sans-serif;
    }
}

#dh-app {
    margin-left: 42px;
    display: inline-block;
    padding: 12px 0 0 0;
    
    a {
        text-decoration: none;
        color: #333;
    }

    div:first-child {
        font: 600 24px/32px "Open Sans", sans-serif;
    }
    div:last-child {
        font: normal 14px/18px "Open Sans", sans-serif;
        padding-left: 1px;
    }
}


/*
li[data-tilename="iframeTile"][data-sizex="2"][data-sizey="2"] .tile-header .tile-header-text {
	color: #333;
	font-size: 18px;
}
li[data-tilename="iframeTile"][data-sizex="2"][data-sizey="2"] .tile-header .icon {
	display: none !important;
}
*/



/* .search-filter-content {
    position: relative;
    overflow: hidden;
}
.search-filter-content::before {
    position: absolute;
    display: inline-block;
    top: 0;
    bottom: 0;
    width: fit-content;
    left: 50%;
    transform: translateX(-50%);
    content: attr(data-backdroptext);
    font-size: 256px;
    color: rgba(255, 255, 255, .04);
    line-height: .7;
    font-weight: 700;
} */
.search-filter-content::before {
    display: flex;
    justify-content: center;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    content: attr(data-backdroptext);
    font-size: 256px;
    color: rgba(255, 255, 255, .04);
    line-height: .7;
    font-weight: 600;
    overflow: hidden;
}
/* .search-filter-content {
    background-image: url(datorhjalpen_text_stor_2.png) !important;
    background-size: auto !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-blend-mode: overlay;
} */


/* Center text in messagetiles and fix line-height */
li[data-tilename="messageTile"]:has(.dh-portal-msg-center) .tile-content {
    display: flex !important;
    flex-direction: column;
    justify-content: center;

    * {
        line-height: 1.4 !important;
    }
    :first-child:is(h1, h2, h3) {
        margin: 0 0 .25em 0 !important;
    }
}


/* Textstorlek på headern i alla widgets */
.tile-header .tile-header-text {
	font-size: 18px;
}

/* ALL image widgets */
li[data-tilename="imageTile"] {
    .title {
        line-height: 1.6 !important;
    }
    .description {
        line-height: 1.6 !important;
        /* margin-top: .2em; */
        /* font-size: .9em !important; */
    }
    &[data-sizex="2"]:hover {
        box-shadow: 
            0 0px 0.9px rgba(0, 0, 0, 0.3),
            0 0px 7px rgba(0, 0, 0, 0.6) !important;
    }
}


/* Change border radius on portal widgets */
.procydo-portal ol.gridster li.tile {
    --dh-portal-radius: 4px;
    border-radius: var(--dh-portal-radius);

    .tile-header {
        border-radius: var(--dh-portal-radius) var(--dh-portal-radius) 0px 0px;
    }
    .tile-content {
        border-radius: 0px 0px var(--dh-portal-radius) var(--dh-portal-radius);
    }
    &.widget-layout-spaced .tile-content .tile-list-element {
        border-radius: var(--dh-portal-radius);
        margin: 4px;
        border: none;
    }
    .tile-content.tile-no-header,
    &.hide-title .tile-content {
        border-radius: var(--dh-portal-radius);
    }
}


/* Portalmeny (med widgeten Meddelande) */
.procydo-portal ol.gridster li.tile {
    .tile-header {
        border: none;
    }
    
    &[data-tilename="messageTile"]:has(.dh-portal-menu, .dh-portal-collapsible-menu) .tile-content.message-tile {
        display: flex !important;
        padding: 0 !important;
        background-color: transparent !important;
        border-radius: 0;
    
        div.message-tile {
            padding: 0 !important;
        }
    }

    &:not(:has(.action-menu)) {
        ul.dh-portal-menu {
            list-style-type: none;
            padding: 0;
            margin: 4px 0 0 0;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 4px;
            align-items: stretch;
        
            li {
                flex: 1;
                display: flex;
                flex-direction: column;
                align-items: stretch;
                container-type: size;
            
                a, a:visited {
                    background-color: #0076bc;
                    color: #fff;
                    border-radius: 4px;
                    padding: 0 16px;
                    text-decoration: none;
                    outline: 0;
                    flex: 1;
                    display: flex;
                    align-items: center;
                }
                
                a:hover {
                    background-color: #c0e4f2;
                    color: #333;
                }
            }

            .scroll-bar {
                background-color: transparent !important;
            }
        }
        
        ul.dh-portal-menu-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
        }
        ul.dh-portal-menu.dh-portal-menu-grid li a {
            justify-content: center;
            text-align: center;
        }

    @media (max-width: 824px) {
        &:not(:has(.action-menu)) ul.dh-portal-menu li {
            min-height: 40px;
        
            a {
                /* padding: 8px 16px; */
            }
        }
    }
}

/* Refactor to use grid instead? */
@container (height > 46px) {
    a {
        /* font-size: 24px !important; */
    }
}


/* Portalmeny med utfällbara poster (med widgeten Meddelande) */
.tile:not(:has(.action-menu)) ul.dh-portal-collapsible-menu {
    list-style-type: none;
    padding: 0;
    font-family: open sans;
    line-height: 1.6;
    width: 100%;
    margin-top: .5em;

    & > li {
        background: #0076bc;
        color: #fff;
        padding: .75em 1em;
        margin: 0 0 .5em 0;
        position: relative;
        cursor: pointer;
        border-radius: 4px;

        &:hover {
            background-color: #c0e4f2;
            color: #333;
        }
        .show {
            padding: .75em 1em 0 1em;
            border-radius: 4px 4px 6px 6px;
        }
        ul {
            list-style-type: none;
            background: #fff;
            padding: .5em 1em;
            margin: .75em -1em 0 -1em;
            display: none;
            border-radius: 0 0 4px 4px;
        }
        li {
            padding: .35em 0;
        }

        &::after {
            content: '';
            position: absolute;
            right: .5em;
            top: calc(3.1em / 2 - .75em);
            width: 1.25em;
            height: 1.25em;
            background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'><path fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>");
            background-repeat: no-repeat;
            background-size: 1.25em;
            transition: transform 0.25s ease-in-out;
        }
        &:hover::after {
            background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'><path fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>");
        }
        &.show::after {
            transform: scaleY(-1);
        }
    }

    .show ul {
        display: block;
    }
}




/* Portalmeny (med widgeten Rekommenderade) */
/* li[data-tilename="recommendedGuideTile"][data-sizex="3"] .guide-icon {
    display: none !important;
}
li[data-tilename="recommendedGuideTile"][data-sizex="3"] .tile-content {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    align-items: stretch;
    padding: 4px 0 0 0 !important;
    margin: 0 !important;
}
li[data-tilename="recommendedGuideTile"][data-sizex="3"] .tile-list-element {
    background: transparent !important;
    margin: 0 !important;
    flex: 1;
    display: flex;
    align-items: center;
}
li[data-tilename="recommendedGuideTile"][data-sizex="3"] a {
    background-color: #0076bc;
    border-radius: 4px;
    padding: 0 17px !important;
    text-decoration: none;
    flex: 1;
    display: flex !important;
    align-items: center;
    box-shadow: none !important;
}
li[data-tilename="recommendedGuideTile"][data-sizex="3"] a:active,
li[data-tilename="recommendedGuideTile"][data-sizex="3"] a:hover {
    background-color: #c0e4f2 !important;
    text-decoration: none;
    box-shadow: none !important;
}
li[data-tilename="recommendedGuideTile"][data-sizex="3"] a * {
    color: #fff;
}
li[data-tilename="recommendedGuideTile"][data-sizex="3"] a:hover * {
    color: #333;
    text-decoration: none !important;
}
li[data-tilename="recommendedGuideTile"][data-sizex="3"] a div {
    flex: 1;
} */

