/* Field Grants: solo lo que agrega a elnino-projects.css
   (las tarjetas .projects-container y el slider vienen de ahí). */

/* ===== Tarjetas [field_grants]: icono arriba, título abajo (igual que el widget HTML anterior) ===== */

.fg-cards .card-content {
    justify-content: space-between;
}

.fg-cards .card-icon {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 200px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .fg-cards .card-icon {
        width: 70px;
        height: 70px;
    }
}

/* ===== Página de cada beca: reproduce la página de Elementor original =====
   Valores tomados del CSS que Elementor generaba para esas páginas
   (contenedor de 1140px, separación de 20px, textos de 18px, botones grises). */

.fg-grant {
    --fg-max: 1140px;
    --fg-gap: 20px;
    --fg-text: #333;
}

/* Icono y título */

.fg-grant__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--fg-gap);
    max-width: var(--fg-max);
    margin: 0 auto;
    padding: 3rem 1rem 1rem;
    text-align: center;
}

.fg-grant .fg-grant__icon {
    display: block;
    width: 136px;
    height: auto;
}

.fg-grant .fg-grant__title {
    width: 100%;
    max-width: 833px;
    margin: 0;
    color: var(--fg-text);
    font-family: "Montserrat", sans-serif;
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.3em;
}

/* 📍 Ubicación y 🏢 institución */

.fg-grant__where {
    max-width: var(--fg-max);
    margin: 0 auto;
    padding: 10px 1rem;
    color: var(--fg-text);
    font-size: 18px;
    text-align: center;
}

.fg-grant .fg-grant__where p {
    margin: 0;
    line-height: 1.5;
}

/* Responsable y colaboradores */

.fg-grant__people {
    display: flex;
    flex-direction: column;
    gap: var(--fg-gap);
    max-width: var(--fg-max);
    margin: 0 auto;
    padding: 10px 1rem;
}

.fg-grant__group {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: var(--fg-gap);
}

/* Con colaboradores: dos columnas separadas por una línea, como en las becas colaborativas. */
.fg-grant__people--split {
    flex-direction: row;
    padding-top: 2rem;
}

.fg-grant__people--split .fg-grant__group--lead {
    border-right: 1px solid #eee;
}

.fg-grant .fg-grant__heading {
    margin: 0;
    color: var(--fg-text);
    font-family: "Poppins", sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2em;
    text-align: center;
}

.fg-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--fg-gap);
}

.fg-grant .fg-btn {
    display: inline-block;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background-color: #fafafa;
    color: #404040;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Mismo hover que los botones del sitio (color acento del kit de Elementor). */
.fg-grant a.fg-btn:hover,
.fg-grant a.fg-btn:focus {
    background-color: #febb1d;
    color: #000;
}

.fg-grant a.fg-btn:focus-visible {
    outline: 2px solid #53721c;
    outline-offset: 2px;
}

/* El slider deja aire arriba como el carrusel original. */
.fg-grant .elnino-slider {
    margin-top: var(--fg-gap);
}

/* Summary */

.fg-grant__summary {
    display: flex;
    flex-direction: column;
    gap: var(--fg-gap);
    max-width: var(--fg-max);
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

.fg-grant__summary .fg-grant__heading {
    text-align: left;
}

.fg-grant__text {
    color: var(--fg-text);
    font-size: 18px;
    line-height: 1.8em;
}

.fg-grant .fg-grant__text p {
    margin: 0 0 0.9rem;
}

.fg-grant .fg-grant__text p:last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .fg-grant__hero {
        padding-top: 1rem;
    }

    .fg-grant .fg-grant__title {
        font-size: 27px;
    }

    .fg-grant__people--split {
        flex-direction: column;
    }

    .fg-grant__people--split .fg-grant__group--lead {
        padding-bottom: var(--fg-gap);
        border-right: 0;
        border-bottom: 1px solid #eee;
    }

    .fg-grant__text {
        font-size: 16px;
    }
}

/* ===== Resultados: avances en redes, materiales educativos y coloquio =====
   Misma paleta y medidas que el resto de la página. Lo único que destaca es el folleto. */

.fg-results {
    --fg-green: #53721c;
    --fg-yellow: #febb1d;
    --fg-line: #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: var(--fg-max);
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
    border-top: 1px solid #eee;
    color: var(--fg-text);
}

/* El resumen ya no cierra la página: menos aire abajo. */
.fg-grant__summary:has(+ .fg-results) {
    padding-bottom: 2.5rem;
}

.fg-results > .fg-grant__heading {
    text-align: left;
}

.fg-results__block {
    display: flex;
    flex-direction: column;
    gap: var(--fg-gap);
}

.fg-grant .fg-results__title {
    margin: 0;
    color: var(--fg-text);
    font-family: "Poppins", sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

.fg-grant .fg-results__meta {
    margin: -0.5rem 0 0;
    font-size: 16px;
}

.fg-btns--start {
    justify-content: flex-start;
    gap: 10px;
}

.fg-grant .fg-btn:focus-visible,
.fg-grant .fg-cta:focus-visible,
.fg-grant .fg-product__link:focus-visible,
.fg-grant .fg-timeline__media:focus-visible,
.fg-grant .fg-video:focus-visible {
    outline: 2px solid var(--fg-green);
    outline-offset: 3px;
}

/* --- Avances en redes: una columna por mes, en orden --- */

.fg-grant .fg-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fg-timeline__stop {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.fg-timeline__date {
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.fg-timeline__media {
    display: block;
    overflow: hidden;
    border: 1px solid var(--fg-line);
    border-radius: 12px;
    background: #fafafa;
}

.fg-grant .fg-timeline__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.4s ease;
}

.fg-timeline__media:hover img {
    transform: scale(1.03);
}

/* --- Folleto: el único elemento con presencia propia (una hoja sobre otra) --- */

.fg-booklet {
    display: grid;
    grid-template-columns: minmax(0, 230px) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
    padding: 2rem 2rem 2rem 2.5rem;
    border-radius: 12px;
    background: #fafafa;
}

.fg-booklet__cover {
    display: block;
    transform: rotate(-2deg);
    background: #fff;
    /* Dos hojas detrás de la portada: lee como un impreso, no como una tarjeta. */
    box-shadow:
        0 0 0 1px var(--fg-line),
        6px 6px 0 -1px #fff,
        6px 6px 0 0 var(--fg-line),
        12px 12px 0 -1px #fff,
        12px 12px 0 0 var(--fg-line);
    transition: transform 0.3s ease;
}

.fg-booklet__cover:hover {
    transform: rotate(0deg);
}

.fg-grant .fg-booklet__cover img {
    display: block;
    width: 100%;
    height: auto;
}

.fg-booklet__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.fg-grant .fg-booklet__name {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.25;
}

.fg-grant .fg-booklet__text {
    max-width: 60ch;
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
}

/* Mismo amarillo que el botón DONATE del encabezado. */
.fg-grant .fg-cta {
    display: inline-block;
    padding: 0.85rem 1.4rem;
    border-radius: 6px;
    background: var(--fg-yellow);
    color: #000;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.fg-grant .fg-cta:hover,
.fg-grant .fg-cta:focus {
    background: #f0a800;
    color: #000;
}

/* --- Productos educativos: filas, no tarjetas --- */

.fg-grant .fg-products {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fg-product {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
    margin: 0;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.fg-product:last-child {
    border-bottom: 0;
}

.fg-grant .fg-product__thumb {
    display: block;
    width: 88px;
    height: 88px;
    border: 1px solid var(--fg-line);
    border-radius: 8px;
    background: #fafafa;
    object-fit: cover;
    object-position: top center;
}

/* Producto sin archivo: se deja el hueco para que los textos sigan alineados. */
.fg-grant .fg-product__thumb--empty {
    border: 0;
    background: none;
}

.fg-product__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fg-grant .fg-product__text {
    max-width: 70ch;
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
}

.fg-grant .fg-product__link {
    align-self: flex-start;
    color: var(--fg-green);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fg-grant .fg-product__link:hover {
    color: #000;
}

/* --- Video del coloquio (se carga al hacer clic) --- */

.fg-grant .fg-video {
    position: relative;
    display: block;
    width: 100%;
    max-width: 820px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #000;
}

.fg-grant .fg-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.fg-video:hover img {
    opacity: 1;
}

.fg-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--fg-yellow);
    transform: translate(-50%, -50%);
}

.fg-video__play svg {
    width: 30px;
    height: 30px;
    margin-left: 4px;
    fill: #000;
}

@media (prefers-reduced-motion: reduce) {
    .fg-timeline__media img,
    .fg-booklet__cover,
    .fg-video img {
        transition: none;
    }

    .fg-timeline__media:hover img {
        transform: none;
    }
}

@media (max-width: 767px) {
    .fg-results {
        gap: 2rem;
        padding-top: 2rem;
    }

    /* Los meses pasan a una sola columna. */
    .fg-grant .fg-timeline {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .fg-booklet {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
        padding: 1.75rem 1.5rem 1.5rem;
    }

    .fg-booklet__cover {
        width: min(240px, 80%);
        margin: 0 auto;
    }

    .fg-grant .fg-booklet__name {
        font-size: 1.4rem;
    }

    .fg-product {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 1rem;
    }

    .fg-grant .fg-product__thumb {
        width: 64px;
        height: 64px;
    }

    .fg-grant .fg-product__text {
        font-size: 16px;
    }
}
