/*
 * Homepage full-width.
 * Astra mantiene header/footer, ma il contenuto Home occupa tutta la larghezza.
 */
body.home .site-content > .ast-container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

body.home .entry-content {
    margin: 0;
}

body.home .entry-header {
    display: none;
}

/* =========================
 * INTRO BANNER
 * ========================= */

.siae-home-intro {
    background: #0b8db3;
    color: #fff;
}

.siae-home-intro__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 42px 24px;
}

.siae-home-intro h2 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 600;
}

.siae-home-intro p {
    margin: 0;
    font-size: 17px;
    line-height: 1.7;
}

/* =========================
 * HOME SERVICES
 * ========================= */

.siae-home-services {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.siae-home-service {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 290px;
    color: #fff;
}

.siae-home-service__image-link {
    display: block;
    min-height: 290px;
    overflow: hidden;
}

.siae-home-service__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.siae-home-service:hover .siae-home-service__image {
    transform: scale(1.035);
}

.siae-home-service__content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
}

.siae-home-service__title {
    margin: 0 0 18px;
    color: #fff;
    font-size: 25px;
    font-weight: 600;
    line-height: 1.15;
}

.siae-home-service__title a {
    color: inherit;
    text-decoration: none;
}

.siae-home-service__description {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
}

.siae-home-service--1,
.siae-home-service--5 {
    background: #0bacb8;
}

.siae-home-service--2,
.siae-home-service--6 {
    background: #089bb8;
}

.siae-home-service--3,
.siae-home-service--7 {
    background: #325560;
}

.siae-home-service--4,
.siae-home-service--8 {
    background: #398098;
}

@media (max-width: 1024px) {
    .siae-home-services {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .siae-home-service {
        grid-template-columns: 1fr;
    }

    .siae-home-service__image-link {
        min-height: auto;
    }

    .siae-home-service__image {
        aspect-ratio: 1 / 1;
    }

    .siae-home-service__content {
        padding: 28px 22px;
    }
}

/* =========================
 * LATEST NEWS
 * ========================= */

.siae-home-news {
    padding: 56px 24px 64px;
    background: #f5f6f7;
}

.siae-home-news__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.siae-home-news__heading {
    margin: 0 0 32px;
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 600;
    color: #163856;
}

.siae-home-news__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.siae-home-news__item {
    background: #fff;
    border: 1px solid rgba(22, 56, 86, 0.10);
}

.siae-home-news__content {
    padding: 24px;
}

.siae-home-news__date {
    display: block;
    margin-bottom: 10px;
    color: #6b747c;
    font-size: 13px;
}

.siae-home-news__title {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.35;
}

.siae-home-news__title a {
    color: #163856;
    text-decoration: none;
}

.siae-home-news__title a:hover,
.siae-home-news__title a:focus {
    text-decoration: underline;
}

.siae-home-news__excerpt {
    margin: 0 0 18px;
    line-height: 1.6;
}

.siae-home-news__more {
    font-weight: 600;
    text-decoration: none;
}

.siae-home-news__footer {
    margin-top: 34px;
    text-align: center;
}

@media (max-width: 900px) {
    .siae-home-news__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .siae-home-news__grid {
        grid-template-columns: 1fr;
    }

    .siae-home-news {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ==========================================================
 * LATEST NEWS BAR
 * Migrazione template Joomla ENAR / mod_k2_content Latestnews
 * ========================================================== */

.siae-newsbar {
    background: #1c2124;
    overflow: hidden;
}

.siae-newsbar__inner {
    position: relative;
    width: 100%;
    min-height: 57px;
}

.siae-newsbar__title {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    width: 168px;
    height: 100%;
    min-height: 57px;

    display: flex;
    align-items: center;

    padding: 0 15px;

    background: #008AC9;
    color: #fff;

    font-family: "Lato", Arial, sans-serif;
    font-size: 15px;
    font-style: italic;
    text-transform: uppercase;
    white-space: nowrap;
}

.siae-newsbar__title::after {
    position: absolute;
    content: "";
    right: 1px;
    top: 0;
    width: 4px;
    height: 100%;
    background: #1c2124;
}

.siae-newsbar__title-icon {
    position: relative;
    display: inline-block;
    flex: 0 0 24px;
    width: 24px;
    height: 28px;
    margin-right: 8px;
}

.siae-newsbar__title-icon::before {
    position: absolute;
    left: 7px;
    top: 3px;
    width: 1px;
    height: 22px;
    background: #fff;
    content: "";
}

.siae-newsbar__title-icon::after {
    position: absolute;
    left: 2px;
    top: 5px;
    width: 15px;
    height: 6px;
    border: 1px solid #fff;
    border-radius: 4px;
    content: "";
}

.siae-newsbar__bar {
    position: relative;
    width: 100%;
    padding: 15px 50px 15px 183px;
    font-size: 13px;
}

.siae-newsbar__viewport {
    width: 100%;
    overflow: hidden;
}

.siae-newsbar__track {
    display: flex;
    align-items: center;
    will-change: transform;
    transition: transform 2s ease;
}

.siae-newsbar__item {
    flex: 0 0 20%;
    min-width: 0;

    padding-right: 15px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.siae-newsbar__item a {
    color: #aaa;
    text-decoration: none;
    text-transform: uppercase;
}

.siae-newsbar__item a:hover,
.siae-newsbar__item a:focus {
    color: #fff;
}

.siae-newsbar__arrow {
    margin-right: 5px;
    color: #aaa;
}

.siae-newsbar__control {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;

    width: 35px;
    height: 100%;

    padding: 0;
    border: 0;
    border-left: 1px solid #008AC9;
    border-right: 1px solid #008AC9;
    border-radius: 0;

    background: rgba(0, 0, 0, 0.6);
    color: #fff;

    cursor: pointer;
}

.siae-newsbar__control::before {
    position: absolute;
    content: "";
    left: -8px;
    top: -8px;

    border-style: solid;
    border-width: 8px;
    border-color:
        transparent
        transparent
        #008AC9
        transparent;

    transform: rotate(45deg);
}

.siae-newsbar__play {
    display: none;
}

.siae-newsbar__control:not(.is-playing) .siae-newsbar__pause {
    display: none;
}

.siae-newsbar__control:not(.is-playing) .siae-newsbar__play {
    display: inline;
}

/* 4 elementi */
@media (max-width: 1599px) {
    .siae-newsbar__item {
        flex-basis: 25%;
    }
}

/* 3 elementi */
@media (max-width: 1199px) {
    .siae-newsbar__item {
        flex-basis: 33.333333%;
    }
}

/* 2 elementi */
@media (max-width: 785px) {
    .siae-newsbar__title {
        display: none;
    }

    .siae-newsbar__bar {
        padding-left: 15px;
    }

    .siae-newsbar__item {
        flex-basis: 50%;
    }
}

/* 1 elemento */
@media (max-width: 449px) {
    .siae-newsbar__item {
        flex-basis: 100%;
    }
}

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

/* ==========================================================
 * MOBILE REFINEMENT
 * ========================================================== */

@media (max-width: 544px) {

    /* Intro */
    .siae-home-intro__inner {
        padding: 25px 20px;
    }

    .siae-home-intro h2 {
        font-size: 21px;
        line-height: 1.25;
        margin-bottom: 14px;
    }

    .siae-home-intro p {
        font-size: 14px;
        line-height: 1.6;
    }

    /* News bar */
    .siae-newsbar__bar {
        padding-top: 11px;
        padding-bottom: 11px;
        padding-left: 12px;
        padding-right: 45px;
    }

    .siae-newsbar__item {
        font-size: 11px;
    }
}

/* ----------------------------------------------------------
 * Mobile Latest News readability
 * ---------------------------------------------------------- */

@media (max-width: 544px) {

    .siae-newsbar {
        min-height: 38px;
    }

    .siae-newsbar__inner {
        min-height: 38px;
    }

    .siae-newsbar__bar {
        min-height: 38px;
        padding: 10px 42px 10px 12px;
    }

    .siae-newsbar__viewport {
        min-height: 18px;
    }

    .siae-newsbar__item {
        flex-basis: 100%;
        font-size: 11px;
        line-height: 18px;
        padding-right: 8px;
    }

    .siae-newsbar__item a {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .siae-newsbar__control {
        width: 34px;
    }
}

/* ----------------------------------------------------------
 * Tablet refinement
 * ---------------------------------------------------------- */

@media (min-width: 545px) and (max-width: 921px) {

    .siae-newsbar__bar {
        min-height: 42px;
        padding-top: 11px;
        padding-bottom: 11px;
        padding-right: 45px;
    }

    .siae-newsbar__item {
        font-size: 12px;
        line-height: 20px;
    }
}

/* ----------------------------------------------------------
 * Latest News label visible on tablet/mobile
 * ---------------------------------------------------------- */

@media (max-width: 921px) {

    .siae-newsbar__title {
        display: flex;
        width: 140px;
        min-height: 42px;
        padding: 0 12px;
        font-size: 11px;
    }

    .siae-newsbar__title-icon {
        margin-right: 6px;
        font-size: 18px;
    }

    .siae-newsbar__bar {
        padding-left: 150px;
    }
}

@media (max-width: 544px) {

    .siae-newsbar__title {
        display: flex;
        width: 105px;
        min-height: 38px;
        padding: 0 8px;
        font-size: 9px;
        line-height: 1.1;
    }

    .siae-newsbar__title-icon {
        display: none;
    }

    .siae-newsbar__bar {
        padding-left: 113px;
    }
}

/* Mantieni l'icona Latest News anche su mobile */
@media (max-width: 544px) {

    .siae-newsbar__title-icon {
        display: inline-block;
        margin-right: 5px;
        font-size: 14px;
        line-height: 1;
    }

    .siae-newsbar__title {
        width: 118px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .siae-newsbar__bar {
        padding-left: 126px;
    }
}

/* Allineamento larghezza servizi homepage al Joomla originale */
.siae-home-services {
    max-width: 980px;
    margin: 36px auto 0;
}


/* Proporzioni servizi homepage più vicine al Joomla originale */
@media (min-width: 1025px) {
    .siae-home-service,
    .siae-home-service__image-link {
        min-height: 360px;
    }
}


/* Proporzioni desktop servizi più vicine al Joomla originale */
@media (min-width: 1025px) {
    .siae-home-service {
        min-height: 0;
        aspect-ratio: 1.35 / 1;
    }

    .siae-home-service__image-link {
        min-height: 0;
        height: 100%;
    }
}


/* Proporzioni definitive servizi homepage - stile Joomla originale */
@media (min-width: 1025px) {
    .siae-home-services {
        max-width: 980px;
        margin: 36px auto 0;
    }

    .siae-home-service {
        min-height: 0;
        height: 245px;
        aspect-ratio: auto;
        grid-template-columns: 1fr 1fr;
    }

    .siae-home-service__image-link {
        min-height: 0;
        height: 245px;
    }

    .siae-home-service__image {
        width: 100%;
        height: 245px;
        object-fit: cover;
    }

    .siae-home-service__content {
        height: 245px;
        padding: 22px;
    }

    .siae-home-service__title {
        margin-bottom: 12px;
        font-size: 18px;
    }

    .siae-home-service__description {
        font-size: 13px;
        line-height: 1.55;
    }
}

