/*
 * Phone listing of "Nuestros proyectos" — see app/proyectos-grid.php.
 *
 * The section that holds it is flagged `hidden-desktop hidden-tablet` in
 * Elementor, so these rules only ever paint below 768px; they are written
 * mobile-first anyway and the grid grows to two columns on wide phones and
 * foldables, which is also what keeps the layout sane if the section is ever
 * shown on a larger screen.
 *
 * Colours come from the Elementor kit: #192A36 "Negro", #016E06 "Principal",
 * #EDEDED "Gris claro".
 */

.solaria-projects {
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 640px;
    /* Elementor's column already adds 10px on each side on mobile; this brings
       the gutter to a comfortable 18px without touching the section settings. */
    padding: 0 8px;
    width: 100%;
}

.solaria-projects *,
.solaria-projects *::before,
.solaria-projects *::after {
    box-sizing: border-box;
}

.solaria-projects__list {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr);
    list-style: none;
    margin: 0;
    padding: 0;
}

.solaria-projects__item {
    display: block;
    margin: 0;
}

.solaria-projects__item.is-hidden {
    display: none;
}

.solaria-projects__card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(25, 42, 54, 0.16);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Focus lands here after each batch is revealed; the outline would otherwise be
   clipped by `overflow: hidden`. */
.solaria-projects__card:focus {
    outline: none;
}

.solaria-projects__card:focus-visible {
    outline: 2px solid #016e06;
    outline-offset: 2px;
}

.solaria-projects__media {
    background: #edf5ed;
    display: block;
    line-height: 0;
    position: relative;
}

.solaria-projects .solaria-projects__image {
    aspect-ratio: 16 / 10;
    display: block;
    height: auto;
    max-width: none;
    object-fit: cover;
    object-position: center center;
    width: 100%;
}

.solaria-projects__image--empty {
    background: #edf5ed;
}

/* Only behind the badge: a full overlay would wash out the photograph. */
.solaria-projects__media::after {
    background: linear-gradient(to bottom, rgba(25, 42, 54, 0.45), rgba(25, 42, 54, 0));
    content: "";
    height: 84px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
}

.solaria-projects__capacity {
    background: rgba(25, 42, 54, 0.92);
    border-radius: 3px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    left: 12px;
    letter-spacing: 0.01em;
    line-height: 1.2;
    margin: 0;
    padding: 7px 12px;
    position: absolute;
    top: 12px;
    z-index: 1;
}

.solaria-projects__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 18px 18px 20px;
}

/* Brand cue above the name, the same idea as the bar on the press cards. */
.solaria-projects__name {
    color: #192a36;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    margin: 0 0 14px !important;
    padding-top: 12px;
    position: relative;
}

.solaria-projects__name::before {
    background: #016e06;
    content: "";
    height: 3px;
    left: 0;
    position: absolute;
    top: 0;
    width: 32px;
}

.solaria-projects__meta {
    margin: 0;
    padding: 0;
}

.solaria-projects__row {
    align-items: baseline;
    border-top: 1px solid #ededed;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 9px 0;
}

.solaria-projects__row:last-child {
    padding-bottom: 0;
}

.solaria-projects__label {
    align-items: center;
    color: #6b7a85;
    display: flex;
    /* The label takes the leftover room and wraps: "Data de entrada em serviço"
       is twice as long as "Fecha p.e.m." and would otherwise push the value out
       of the card on a 320px screen. */
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    font-weight: 400;
    gap: 6px;
    line-height: 1.4;
    margin: 0;
}

.solaria-projects__icon {
    color: #016e06;
    flex: 0 0 auto;
    /* `baseline` alignment on the row would drop the glyph a couple of pixels. */
    position: relative;
    top: 2px;
}

.solaria-projects__value {
    color: #192a36;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    text-align: right;
}

.solaria-projects__actions {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.solaria-projects__more {
    align-items: center;
    background: #192a36;
    border: 0;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    gap: 10px;
    justify-content: center;
    line-height: 1.2;
    min-height: 52px;
    min-width: 220px;
    padding: 16px 32px;
    transition: background-color 160ms ease;
}

.solaria-projects__more:hover,
.solaria-projects__more:focus-visible {
    background: #016e06;
    color: #fff;
}

.solaria-projects__more-count {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 10px;
}

.solaria-projects__sr {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* Newly revealed cards fade in so the batch reads as an addition, not a jump. */
.solaria-projects__item.is-revealed {
    animation: solaria-projects-reveal 320ms ease both;
}

@keyframes solaria-projects-reveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .solaria-projects__item.is-revealed {
        animation: none;
    }
}

/* Wide phones and foldables: two columns before the map takes over at 768px. */
@media (min-width: 560px) {
    .solaria-projects__list {
        gap: 22px 20px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .solaria-projects__body {
        padding: 16px 16px 18px;
    }
}
