.node--type-directorate {
    .content {
        .primary {
            width: 100%;

            .field--name-body {
                padding-left: 2rem;
                padding-right: 2rem;
            }

            .paragraph.blue,
            .paragraph.grey {
                max-width: 81em;
                margin: 0 auto 2em;
            }

        }

        &:has(section.secondary) {
            display: flex;
            flex-wrap: wrap;
            max-width: 85em;
            margin: 0 auto;

            .primary {
                width: 75%;
                max-width: min(100%, 75%);
            }

            .secondary {
                width: 25%;
                height: max-content;

                .para-section {
                    padding: 0;
                }
            }
        }
    }
}


.node--type-directorate.node--view-mode-full div.banner {
    background: #efefef;
    padding: 1rem 0 2rem 0;
    margin-bottom: 2rem;
}

.node--type-directorate.node--view-mode-full div.banner {
    display: flex;
    flex-wrap: wrap;
}

.node--type-directorate.node--view-mode-full div.banner {

    > .inner {
        max-width: 85em;
        margin: 0 auto;
        padding: 0 2em;
        width: 100%;
        background: transparent;

        .intro {
            max-width: 60ch;
            max-width: min(100%, 60ch);
        }
    }

    &:has(img:nth-child(3)) > .inner {
        display: grid;
        grid-template: 4fr 2fr;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 0.5rem;

        .intro {
            background: var(--primary);
            color: white;
            padding: 2rem;
            border-radius: 1em;
            grid-column: 1 / 5;
            grid-row: 3;
            padding-right: 2rem;
            max-width: 100%;
            
            h1 {
                color: white;
            }
        }
    }
}

.node--type-directorate.node--view-mode-full div.banner > .field {
    width: 100%;
}

.node--type-directorate.node--view-mode-full div.banner img {
    max-width: 100%;
}

.node--type-directorate.node--view-mode-full div.banner > .inner img {
    margin: 0;
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 1em;
    object-fit: cover;

    &:first-of-type {
        aspect-ratio: 1;
        grid-column: 3 / 5;
        grid-row: 1 / 3;
    }

    &:nth-of-type(2) {
        aspect-ratio: 1;
        grid-column: 1 / 3;
        grid-row: 1 / 2;
    }

    &:nth-of-type(3) {
        aspect-ratio: 1;
        grid-column: 1 / 3;
        grid-row: 2 / 3;
    }
}

@media screen and (min-width: 50em) and (max-width:70em){
    .node--type-directorate.node--view-mode-full div.banner:has(img:nth-child(3)) { 
        flex-wrap: nowrap;

        
        > .inner {
            .intro {
                grid-column: 1 / 3;
                grid-row: 2;
            }
            img {
                order: 1;
                align-items: center;
                display: flex;
                justify-content: center;

                &:first-of-type {
                    aspect-ratio: 2 / 1;
                    grid-column: 3 / 5;
                    grid-row: 1 / 2;
                }

                &:nth-of-type(2) {
                    aspect-ratio: 2 / 1;
                    grid-column: 1 / 3;
                    grid-row: 1 / 2;
                }

                &:nth-of-type(3) {
                    aspect-ratio: 2 / 1;
                    grid-column: 3 / 5;
                    grid-row: 2 / 3;
                }
            }
        }
    } 
}

@media screen and (min-width: 70em) {
    .node--type-directorate.node--view-mode-full div.banner:has(img:nth-child(3))  { 
        flex-wrap: nowrap;

        > .inner {

            .intro {
                grid-column: 1 / 2;
                grid-row: 2;
            }
            img {
                order: 1;
                align-items: center;
                display: flex;
                justify-content: center;

                &:first-of-type {
                    aspect-ratio: 1;
                    grid-column: 3 / 5;
                    grid-row: 1 / 3;
                }

                &:nth-of-type(2) {
                    aspect-ratio: 2 / 1;
                    grid-column: 1 / 3;
                    grid-row: 1 / 2;
                }

                &:nth-of-type(3) {
                    aspect-ratio: 1;
                    grid-column: 2 / 3;
                    grid-row: 2 / 3;
                }
            } 
        }
    }
}


.field--name-field-banner-block {
    .views-exposed-form .form--inline {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        justify-content: flex-start;

        form {
            accent-color: var(--primary);
        }

        .form-type-search,
        .form-type-search-api-autocomplete {
            width: 60%;
            margin: 0;

            input {
                border-radius: 1em;
                padding-left: 1rem;
            }
        }

        .form-type-radio input {
            width: 1em;
            height: 1em;
        }

        .form-actions {
            width: calc(40% - 1em);
            margin-left: 1em;
            gap: 0.5em;

            input {
                display: block;
                height: max-content;
                margin: 0;
                padding: 0.5rem 2rem;
                width: auto;
            }
        }


        details {
            order: 2;
            margin: 1em 0 0;

            summary {
                display: flex;
                align-items: center;
                color: var(--primaryDark);
                padding: 0;

                &:before {
                    font-family: 'icomoon';
                    content: "\e919";
                    padding: 0;
                    font-size: 2em;
                    opacity: 0.5;
                    position: relative;
                    top: 2px;
                }
            }

            &[open] > summary:before {
                content: "\e918";
            }

            .details-wrapper {
                padding: 0.5rem 1.5rem;
                margin: 0;
                border-radius: 1em;
                box-shadow: 0 4px 4px rgba(0, 0, 0, 0.15);

                details {
                    margin: 0;
                    + details {
                        border-top: 2px solid var(--backgroundAlt);
                    }

                    .details-wrapper {
                        padding: 0 0 1em 2em;
                        border-radius: 0;
                        box-shadow: none;
                    }

                    #edit-sort-bef-combine--wrapper {
                        legend {
                            display: none;
                        }
                    }

                    
                }
            }
        }
    }
}

/* Related section */
.node--type-directorate {
    .related {
        color: white;

        > h2 {
            width: 100%;
            max-width: 85rem;
            margin: 0 auto;
            padding: 1rem 2rem;
            color: white;
        }

        > .list {
            width: 100%;
            max-width: 85rem;
            margin: 0 auto;
            padding: 0 2rem 2rem;
            gap: 1em;

            > .entry {
                max-width: calc(25% - 1em);
                margin: 0;
                width: 100%;

                a {
                    color: white;
                    display: block;
                    background: var(--primaryDark);
                    padding: 2rem;
                    height: 100%;
                    border-radius: 0.5em;
                    font-size: 1.5em;
                    text-decoration: none;
                    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.15);
                    position: relative;

                    &:hover {
                        background-color: var (--highlightBlue);

                        &:after {
                            right: 0.25rem;
                            transition: all ease-in 0.25s;
                        }
                    }

                    &:after {
                        position: absolute;
                        font-family: 'icomoon';
                        content: "\e908";
                        bottom: 0.5rem;
                        right: 0.5rem;
                        transition: all ease-in 0.25s;
                    }
                }
            }
        }
    }
}