//* VARIABILI
//* ***********************************************************
@breakpointSmall: 639px;
@breakpointMedium: 959px;
@breakpointLarge: 1439px;
@breakpointXLarge: 1599px;

@headerHeight: 500px;

//* ***********************************************************


.c-newsroom {
    margin-bottom: 150px;
}


//* Header principale news In Evidenza
.c-newsroom__header {
    position: relative;
    padding-top: 160px;

    .c-newsroom__headerBackground {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: @headerHeight;
        background-color: var(--globalBackground);
        background-image: url("../../../Content/Images/patter_header_02.png");
        background-size: contain;
        background-position: left center;
        background-repeat: no-repeat;
    }

    .c-newsroom__headerContent {
        position: relative;
    }

    .c-newsroom__itemLink {
        width: max-content;
        font-family: var(--baseBodyFontFamily);
        font-size: var(--globalLargeFontSize);
        font-weight: bold;
        color: var(--globalBackground);
        line-height: 1;
        text-transform: uppercase;
        text-decoration: underline;
        margin-top: var(--globalMargin);
    }

    @media (max-width: @breakpointMedium) {
        background-color: var(--globalBackground);
        background-image: url("../../../Content/Images/patter_header_02.png");
        background-size: cover;
        background-position: left center;
        background-repeat: no-repeat;
        padding-top: 100px;
        margin-bottom: var(--globalMediumMargin);

        .c-newsroom__headerBackground {
            background-image: none;
            background-color: transparent;
        }

        .c-newsroom__item.isHighlighted {
            // stili base dentro la classe .c-newsroom__item
            flex-wrap: wrap;
            margin-bottom: var(--globalMargin);

            .c-newsroom__itemTitle {
                font-size: var(--globalLargeFontSize);
                margin-bottom: var(--globalMargin);
                min-height: initial;

                &.withoutAbstract {
                    margin-bottom: var(--globalGutter);
                }
            }

            .c-newsroom__itemAbstract {
                margin-bottom: var(--globalMargin);
                color: var(--globalMutedColor);
            }

            .c-newsroom__itemImage {
                width: 100%;
                min-height: 400px
            }
        }

        .c-newsroom__itemLink {
            color: var(--globalEmphasisColor);
            margin-top: 0;
            margin-bottom: var(--globalMediumMargin);
        }
    }

    @media (max-width: @breakpointSmall) {
        .c-newsroom__item.isHighlighted {
            .c-newsroom__itemImage {
                display: block;
                width: 100%;
                min-height: 280px
            }
        }
    }
}

//* Titolo NEWSROOM con triangolo
.c-newsroom__title {
    margin: 110px 0 var(--globalMargin);
    font-family: var(--baseHeadingFontFamily);

    .c-newsroom__header & {
        position: absolute;
        top: 0;
        left: 0;
        margin: 0;


        & > span {
            &:first-of-type {
                color: var(--globalInverseColor);
            }
        }
    }

    & > span {
        color: var(--globalEmphasisColor);
        font-size: 40px;
        line-height: 27px;
        font-weight: bold;


        &:first-of-type {
            color: var(--globalBackground);
            font-weight: normal;
        }
    }

    @media (max-width: @breakpointMedium) {
        .c-newsroom__header & {
            position: static;
            margin-bottom: var(--globalMargin);
        }
    }
}

.c-newsroom__titleTriangle {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 23px 0 0 23px;
    border-color: transparent transparent transparent var(--globalEmphasisColor);
}


// Stile ITEM
.c-newsroom__itemWrapper {
    padding-top: 40px;

    &:nth-child(2n+1) {
        padding-right: var(--globalGutter);
    }

    &:nth-child(2n) {
        padding-left: var(--globalGutter);
    }

    @media (max-width: @breakpointMedium) {
        padding-top: var(--globalGutter);

        &:nth-child(2n+1) {
            padding-right: 0;
        }

        &:nth-child(2n) {
            padding-left: 0;
        }
    }
}

.c-newsroom__itemAnchorWrapper {
    position: relative;

    &:hover {
        .c-newsroom__item {
            text-decoration: none;
            transform: scale(1.01);
            box-shadow: 0 5px 40px 0 rgba(0,0,0,0.15);
        }
    }
}

.c-newsroom__itemAnchor {
    position: absolute;
    inset: 0;
}

.c-newsroom__itemImage {
    width: 200px;
    min-height: 200px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    @media (max-width: @breakpointSmall) {
        display: none;
    }
}

.c-newsroom__itemTexts {
    flex-grow: 1;
    padding: var(--globalMediumGutter);

    @media (max-width: @breakpointSmall) {
        padding: var(--globalGutter);
    }
}

.c-newsroom__itemHeader {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;

    @media (max-width: @breakpointSmall) {
        flex-direction: column;
    }
}

.c-newsroom__loadMore {
    margin: 40px 0;
    font-size: var(--globalLargeFontSize);
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;

    &:hover {
        text-decoration: none;
    }
}


// Classi ITEM condivise
.c-newsroom__itemCategory {
    font-family: var(--baseHeadingFontFamily);
    color: var(--globalBackground);
    text-transform: uppercase;
}

.c-newsroom__itemDate {
    font-family: var(--baseHeadingFontFamily);

    & > span {
        color: var(--globalBackground);

        & + span {
            color: var(--globalEmphasisColor);
        }
    }
}

.c-newsroom__itemTitle {
    display: -webkit-box;
    font-size: var(--globalFontSize);
    color: var(--globalColor);
    font-weight: bold;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: var(--globalMargin);
    overflow: hidden;

    @media (max-width: @breakpointSmall) {
        &.withoutAbstract {
            -webkit-line-clamp: unset;
        }
    }
}

.c-newsroom__itemAbstract {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto;
    font-size: 15px;
    line-height: 1.27;
    color: var(--globalColor);
    opacity: 0.7;
}


// Gestione varianti di stile dell'Item in base alla Tassonomia
.c-newsroom__item {
    position: relative;
    pointer-events: none;
    background-color: var(--globalMutedBackground);
    text-decoration: none;
    transition: all .3s ease-in-out;
    transform: scale(1);
    z-index: 1;

    &.isHighlighted {
        margin-bottom: 110px;
        background-color: transparent;

        .c-newsroom__itemImage {
            width: 60%;
            height: 100%;
            min-height: @headerHeight;
            box-shadow: 0 var(--globalMargin) 70px -10px rgba(0, 0, 0, 0.5);
        }

        .c-newsroom__itemTexts {
            flex-grow: 1;
            padding: 0 5% 0 0;
        }

        .c-newsroom__itemHeader {
            margin-bottom: var(--globalMediumMargin);
            font-size: var(--globalMediumFontSize);
        }

        .c-newsroom__itemCategory {
            color: var(--globalPrimaryBackground);
        }

        .c-newsroom__itemDate {
            line-height: 1em;

            & > span {
                color: var(--globalInverseColor);

                & + span {
                    color: var(--globalInverseColor);
                }
            }
        }

        .c-newsroom__itemTitle {
            font-family: var(--baseHeadingFontFamily);
            font-size: 32px;
            color: var(--globalInverseColor);
            line-height: 1.1;
            min-height: 100px;
            margin-bottom: 70px;
            -webkit-line-clamp: 3;

            &.withoutAbstract {
                margin-bottom: 150px;
            }
        }

        .c-newsroom__itemAbstract {
            font-size: var(--globalMediumFontSize);
            margin-bottom: var(--mediumMargin);
            line-height: var(--globalLineHeight);
            opacity: 1;
            min-height: 80px;
        }

        &:hover {
            text-decoration: none;
        }
    }

    &.isBarcolana {
        background-color: var(--globalBackground);

        .c-newsroom__itemCategory {
            color: var(--globalPrimaryBackground);
        }

        .c-newsroom__itemDate {
            & > span {
                color: var(--globalInverseColor);

                & + span {
                    color: var(--globalPrimaryBackground);
                }
            }
        }

        .c-newsroom__itemTitle {
            color: var(--globalInverseColor);
        }

        .c-newsroom__itemAbstract {
            color: var(--globalInverseColor);

            a {
                color: inherit;

                &:hover {
                    color: var(--globalEmphasisColor);
                }
            }
        }
    }

    a {
        pointer-events: all;
    }
}
