/*
|--------------------------------------------------------------------------
| NOTICIAS ALTEA — HOME MODULAR
|--------------------------------------------------------------------------
*/

.news-home-grid {
    --home-green: #15302b;
    --home-green-dark: #0d2420;
    --home-green-soft: #254d43;
    --home-paper: #f7f7f3;
    --home-white: #fff;
    --home-sand: #efede6;
    --home-ink: #17211e;
    --home-muted: #68726e;
    --home-line: #d9dfdc;
    --home-accent: #92b8aa;

    color: var(--home-ink);
    background: var(--home-paper);
}

/*
|--------------------------------------------------------------------------
| HERO COMPACTO
|--------------------------------------------------------------------------
*/

.compact-news-hero {
    position: relative;
    display: grid;
    width: 100%;
    height: 38vh;
    min-height: 300px;
    max-height: 430px;
    overflow: hidden;
    place-items: center;
    color: var(--home-white);
    background: var(--home-green-dark);
}

.compact-news-hero__media {
    position: absolute;
    inset: 0;
    display: block;
}

.compact-news-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.22, 1, .36, 1);
}

.compact-news-hero:hover .compact-news-hero__media img {
    transform: scale(1.025);
}

.compact-news-hero__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            rgba(5, 26, 20, .7),
            rgba(5, 26, 20, .48),
            rgba(5, 26, 20, .7)
        );
}

.compact-news-hero__content {
    position: relative;
    z-index: 2;
    width: min(1000px, calc(100% - 48px));
    text-align: center;
    pointer-events: none;
}

.compact-news-hero__content > span {
    display: inline-block;
    margin-bottom: 17px;
    color: #b4d4c8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.compact-news-hero h1 {
    margin: 0;
    font: 500 clamp(34px, 4.7vw, 66px)/1.04 "Manrope", sans-serif;
    letter-spacing: -.045em;
}

.compact-news-hero h1 a {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
}

.compact-news-hero h1 a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 9px;
}

.compact-news-hero--empty {
    background:
        linear-gradient(
            115deg,
            rgba(10, 36, 29, .97),
            rgba(26, 69, 58, .88)
        ),
        url("../assets/backgrounds/background-home.jpg")
        center / cover;
}

/*
|--------------------------------------------------------------------------
| CONTENEDOR Y SECCIONES
|--------------------------------------------------------------------------
*/

.home-grids-shell {
    width: min(1280px, calc(100% - 64px));
    margin: 0 auto;
    padding: 92px 0 125px;
}

.home-grid-section {
    margin-bottom: 105px;
}

.home-grid-section:last-child {
    margin-bottom: 0;
}

.home-grid-section--project {
    padding-top: 90px;
    border-top: 1px solid var(--home-line);
}

.home-grid-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 35px;
    margin-bottom: 38px;
}

.home-grid-heading p {
    margin: 0 0 12px;
    color: var(--home-green-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.home-grid-heading h2 {
    margin: 0;
    font: 500 clamp(34px, 4vw, 54px)/1.05 "Manrope", sans-serif;
    letter-spacing: -.045em;
}

.home-grid-heading > span {
    max-width: 290px;
    padding-bottom: 7px;
    color: var(--home-muted);
    font-size: 13px;
    text-align: right;
}

/*
|--------------------------------------------------------------------------
| DESTACADA
|--------------------------------------------------------------------------
*/

.home-featured-card {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .8fr);
    min-height: 500px;
    overflow: hidden;
    background: var(--home-white);
    border: 1px solid var(--home-line);
    box-shadow: 0 24px 65px rgba(15, 38, 32, .1);
}

.home-featured-card__image {
    display: block;
    min-height: 500px;
    overflow: hidden;
    background: var(--home-green);
}

.home-featured-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.22, 1, .36, 1);
}

.home-featured-card__image:hover img {
    transform: scale(1.035);
}

.home-featured-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(35px, 5vw, 65px);
}

.home-card-tag {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--home-green-soft);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.home-featured-card h3 {
    margin: 0;
    font: 500 clamp(30px, 3.4vw, 48px)/1.08 "Manrope", sans-serif;
    letter-spacing: -.04em;
}

.home-featured-card h3 a,
.home-news-card h3 a {
    color: inherit;
    text-decoration: none;
}

.home-featured-card h3 a:hover,
.home-news-card h3 a:hover {
    color: var(--home-green-soft);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.home-featured-card__content > p {
    margin: 24px 0 0;
    color: var(--home-muted);
    font-size: 16px;
    line-height: 1.72;
}

.home-featured-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 38px;
    padding-top: 22px;
    border-top: 1px solid var(--home-line);
}

.home-featured-card time,
.home-news-card time {
    color: var(--home-muted);
    font-size: 12px;
}

.home-read-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--home-green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
}

/*
|--------------------------------------------------------------------------
| GRILLAS DE TRES CARDS
|--------------------------------------------------------------------------
*/

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

.home-news-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    background: var(--home-white);
    border: 1px solid var(--home-line);
    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.home-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 52px rgba(15, 38, 32, .11);
}

.home-news-card__image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--home-sand);
}

.home-news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}

.home-news-card__image:hover img,
.home-news-card:hover .home-news-card__image img {
    transform: scale(1.04);
}

.home-news-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 27px;
}

.home-news-card h3 {
    margin: 0;
    font: 600 clamp(20px, 2vw, 27px)/1.19 "Manrope", sans-serif;
    letter-spacing: -.028em;
}

.home-news-card__body > p {
    margin: 17px 0 0;
    color: var(--home-muted);
    line-height: 1.65;
}

.home-news-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: auto;
    padding-top: 27px;
}

.home-card-arrow {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    color: var(--home-white);
    background: var(--home-green);
    border-radius: 50%;
    text-decoration: none;
    transition:
        background .25s ease,
        transform .25s ease;
}

.home-card-arrow:hover {
    background: var(--home-green-soft);
    transform: translate(2px, -2px);
}

.home-grid-empty {
    padding: 35px;
    color: var(--home-muted);
    text-align: center;
    background: var(--home-sand);
    border: 1px solid var(--home-line);
}

/*
|--------------------------------------------------------------------------
| TABLET
|--------------------------------------------------------------------------
*/

@media (max-width: 1000px) {
    .home-featured-card {
        grid-template-columns: 1fr;
    }

    .home-featured-card__image {
        min-height: 390px;
        max-height: 520px;
    }

    .home-news-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-news-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .home-news-card:last-child:nth-child(odd) {
        display: grid;
        grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
    }

    .home-news-card:last-child:nth-child(odd)
    .home-news-card__image {
        height: 100%;
        aspect-ratio: auto;
    }
}

/*
|--------------------------------------------------------------------------
| MÓVIL
|--------------------------------------------------------------------------
*/

@media (max-width: 680px) {
    .compact-news-hero {
        height: 34vh;
        min-height: 270px;
        max-height: 350px;
    }

    .compact-news-hero__content {
        width: calc(100% - 40px);
    }

    .compact-news-hero h1 {
        font-size: clamp(32px, 10vw, 47px);
    }

    .home-grids-shell {
        width: calc(100% - 36px);
        padding: 65px 0 85px;
    }

    .home-grid-section {
        margin-bottom: 75px;
    }

    .home-grid-section--project {
        padding-top: 65px;
    }

    .home-grid-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
        margin-bottom: 27px;
    }

    .home-grid-heading > span {
        padding: 0;
        text-align: left;
    }

    .home-featured-card__image {
        min-height: 275px;
    }

    .home-featured-card__content {
        padding: 29px 24px;
    }

    .home-featured-card footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-news-cards {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .home-news-card:last-child:nth-child(odd) {
        display: flex;
        grid-column: auto;
    }

    .home-news-card:last-child:nth-child(odd)
    .home-news-card__image {
        aspect-ratio: 16 / 10;
    }

    .home-news-card__body {
        padding: 24px;
    }
}

/*
|--------------------------------------------------------------------------
| VISIBILIDAD AUTOMÁTICA DE GRILLAS
|--------------------------------------------------------------------------
|
| PHP añade is-empty cuando la colección no contiene noticias.
| La sección completa se retira del flujo visual.
|
*/

.news-home-grid .home-grid-section.is-empty {
    display: none !important;
}

