/*
 Theme Name: GeneratePress Child
 Template: generatepress
*/

/* =====================================================
   PALETA FACIALIX
===================================================== */

:root {
    --fx-green: #3f8f2e;
    --fx-green-dark: #2f6e22;
    --fx-text: #111111;
    --fx-text-soft: #555555;
    --fx-border: #e6e6e6;
    --fx-bg: #ffffff;
}

/* =====================================================
   RESET SEGURO
===================================================== */

* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =====================================================
   WRAPPER GENERAL (FIX DEFINITIVO ESPACIADO)
===================================================== */

.home-wrapper {
    width: 100%;
    padding-left: 18px;
    padding-right: 18px;
}

@media (min-width: 1100px) {
    .home-wrapper {
        max-width: 1180px;
        margin: 0 auto;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* =====================================================
   INTRO SEO
===================================================== */

.home-intro {
    margin-bottom: 35px;
}

.home-intro h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--fx-text);
}

.home-intro p {
    font-size: 1rem;
    color: var(--fx-text-soft);
    max-width: 780px;
    line-height: 1.6;
}

/* =====================================================
   HERO PRINCIPAL (LCP OPTIMIZADO)
===================================================== */

.home-hero {
    margin-bottom: 60px;
}

.hero-article {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
}

.hero-link {
    display: block;
    position: relative;
    color: #ffffff;
}

/* Imagen fija ratio */
.hero-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Overlay oscuro estable */
.hero-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.65) 40%,
        rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}

/* Contenido sobre imagen */
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 22px;
    z-index: 2;
}

/* Título principal */
.hero-title {
    font-size: clamp(1.3rem, 4vw, 2rem);
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

/* Extracto */
.hero-excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #f1f1f1;
    max-width: 95%;
}

/* Evita oscurecimiento al hacer hover */
.hero-link:hover .hero-title,
.hero-link:hover .hero-excerpt {
    color: #ffffff;
}

/* =====================================================
   SECCIONES
===================================================== */

.home-trending,
.home-latest,
.home-category {
    margin-bottom: 70px;
}

.home-trending h2,
.home-latest h2,
.home-category h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 8px;
}

/* Línea verde editorial */
.home-trending h2::after,
.home-latest h2::after,
.home-category h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 55px;
    height: 3px;
    background: var(--fx-green);
}

/* =====================================================
   GRID TARJETAS
===================================================== */

.trending-grid,
.latest-grid,
.category-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Tarjeta */
.trending-card,
.latest-card,
.category-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--fx-bg);
    border: 1px solid var(--fx-border);
    transition: transform .15s ease, box-shadow .15s ease;
}

/* Hover editorial limpio */
.trending-card:hover,
.latest-card:hover,
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* Imagen */
.trending-card img,
.latest-card img,
.category-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Título tarjetas */
.trending-card h3,
.latest-card h3,
.category-card h3 {
    font-size: 1rem;
    font-weight: 600;
    padding: 15px;
    line-height: 1.4;
    color: var(--fx-text);
    text-decoration: none;
}

/* Hover cambio de color */
.trending-card:hover h3,
.latest-card:hover h3,
.category-card:hover h3 {
    color: var(--fx-green);
}

/* =====================================================
   SIDEBAR
===================================================== */

.home-sidebar {
    margin-top: 60px;
}

.home-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.home-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home-sidebar li {
    margin-bottom: 12px;
}

.home-sidebar a {
    font-size: 0.95rem;
    color: var(--fx-text);
}

.home-sidebar a:hover {
    color: var(--fx-green);
}

/* =====================================================
   MOBILE AJUSTES
===================================================== */

@media (max-width: 768px) {

    .home-wrapper {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-content {
        padding: 18px;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-excerpt {
        font-size: 0.9rem;
    }

}






/* =====================================
   RESET ANTI OVERFLOW (FIX DEFINITIVO)
===================================== */

html, body {
    overflow-x: hidden;
}

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

/* =====================================
   WRAPPER
===================================== */

.post-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* =====================================
   ANUNCIO SUPERIOR CONTROLADO
===================================== */

/* =====================================
   ANUNCIO SUPERIOR BLOQUEADO
===================================== */

.post-ad-top {
    display: flex;
    justify-content: center;
    margin: 10px 0 20px 0;
}

/* MOBILE */

.ad-mobile {
    display: block;
    width: 320px;
    height: 50px;
    overflow: hidden;
}

.ad-mobile ins.adsbygoogle {
    width: 320px !important;
    height: 50px !important;
}

/* DESKTOP */

.ad-desktop {
    display: none;
}

@media (min-width: 769px) {

    .ad-mobile {
        display: none;
    }

    .ad-desktop {
        display: block;
        width: 728px;
        height: 90px;
        overflow: hidden;
    }

    .ad-desktop ins.adsbygoogle {
        width: 728px !important;
        height: 90px !important;
    }

}


/* =====================================
   HEADER
===================================== */

.post-header {
    max-width: 100%;
}

.post-title {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 15px;
    word-break: break-word;
}

.post-excerpt {
    font-size: 1.15rem;
    color: #666;
    margin-bottom: 20px;
    word-break: break-word;
}

.post-meta {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 30px;
}

/* =====================================
   FEATURED
===================================== */

.post-featured img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 30px;
}

/* =====================================
   CONTENT
===================================== */

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #222;
    overflow-wrap: break-word;
    word-break: break-word;
}

.post-content img,
.post-content iframe,
.post-content table {
    max-width: 100%;
}

/* =====================================
   SHARE
===================================== */

.post-share {
    margin-top: 50px;
    display: flex;
    gap: 12px;
}

.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.fb { background: #1877f2; }
.x { background: #000; }
.wa { background: #25d366; }

/* =====================================
   AUTHOR BOX MEJORADO
===================================== */

.post-author-box {
    margin-top: 60px;
    padding: 30px;
    border-radius: 18px;
    background: #f5f7f4;
    display: flex;
    gap: 25px;
    align-items: center;
    border: 1px solid #e6e6e6;
}

.author-avatar img {
    border-radius: 50%;
    width: 100px;
    height: 100px;
}

.author-info h3 {
    margin-bottom: 6px;
}

.author-role {
    font-size: 0.85rem;
    color: #3f8f2e;
    font-weight: 600;
    margin-bottom: 10px;
}

.author-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 12px;
}

.author-links {
    margin-top: 8px;
}

.author-links a {
    margin-right: 12px;
    font-size: 0.9rem;
    color: #3f8f2e;
    text-decoration: none;
}

.author-links a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .post-author-box {
        flex-direction: column;
        text-align: center;
    }
}

/* =====================================
   COMMENTS LIMPIO
===================================== */

.comments-area {
    margin-top: 60px;
}

.comment-body {
    background: #f8f8f8;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 18px;
}



.hero-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    line-height: 1.15;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
}


/* ======================================================
   AUTHOR PAGE – FACIALIX
====================================================== */

.author-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 16px;
    box-sizing: border-box;
}

/* HEADER */

.author-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 50px;
    border-bottom: 1px solid var(--fx-border);
    padding-bottom: 30px;
}

.author-avatar img {
    border-radius: 50%;
    width: 140px;
    height: 140px;
    object-fit: cover;
}

.author-info h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.author-bio {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--fx-text-soft);
    max-width: 650px;
}

/* POSTS GRID */

.author-posts h2 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 8px;
}

.author-posts h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background: var(--fx-green);
}

.author-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.author-card {
    border: 1px solid var(--fx-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--fx-bg);
    transition: transform .15s ease;
}

.author-card:hover {
    transform: translateY(-4px);
}

.author-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.author-card h3 {
    padding: 16px 16px 6px 16px;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--fx-text);
}

.author-card time {
    display: block;
    padding: 0 16px 16px 16px;
    font-size: 0.85rem;
    color: var(--fx-text-soft);
}

/* PAGINATION */

.author-pagination {
    margin-top: 40px;
}

/* MOBILE */

@media (max-width: 768px) {

    .author-header {
        flex-direction: column;
        text-align: center;
    }

    .author-avatar img {
        width: 110px;
        height: 110px;
    }

}



.footer-custom {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

.footer-custom a {
    color: var(--fx-green);
    text-decoration: none;
}

.footer-custom a:hover {
    text-decoration: underline;
}




/* =====================================
   ENLACES EN CONTENIDO (UX + SEO)
===================================== */

.post-content a {
    color: var(--fx-green);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s ease;
}

.post-content a:hover {
    color: var(--fx-green-dark);
    text-decoration: underline;
}

.post-content a:focus {
    outline: 2px solid var(--fx-green);
    outline-offset: 2px;
}





.mid-related {
    margin: 30px 0;
    padding: 14px 16px;
    background: #f7f9f8;
    border-left: 3px solid var(--fx-green);
    border-radius: 8px;
}

.mid-related-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--fx-green-dark);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.mid-related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mid-related-item {
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    color: var(--fx-text);
}

.mid-related-thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.mid-related-text {
    font-size: 0.88rem;
    line-height: 1.3;
}

.mid-related-item:hover .mid-related-text {
    color: var(--fx-green);
} 


/* =====================================
   MODAL CUPONES – VERSIÓN DEFINITIVA
   Botón aparece al final del contenido
===================================== */

.fx-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 15px;
}

/* Caja principal */
.fx-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;          /* 🔥 Todo el modal scrollea */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Imagen superior */
#fx-modal-img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

/* Contenedor del contenido */
.fx-modal-body {
    padding: 22px;
}

/* Título */
#fx-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* Texto */
#fx-modal-desc {
    white-space: pre-line;
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Cupón */
#fx-modal-coupon {
    font-weight: 600;
}

/* Botón */
.fx-btn {
    display: block;
    background: var(--fx-green);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin-top: 15px;
    transition: background .2s ease;
}

.fx-btn:hover {
    background: var(--fx-green-dark);
}

/* Botón cerrar */
.fx-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 24px;
    cursor: pointer;
    z-index: 2;
}

/* Responsive */
@media (max-width: 600px) {

    .fx-modal-content {
        max-height: 95vh;
    }

    #fx-modal-img {
        max-height: 160px;
    }

    .fx-modal-body {
        padding: 18px;
    }

    #fx-modal-title {
        font-size: 1.2rem;
    }
}