/* =========================
   FUTBOL40 CORE - ESTILOS PÚBLICOS
   v2.51.1 limpieza segura
========================= */

/* =========================
   ANUNCIOS FUTBOL40
========================= */
.f40-ad-slot {
    clear: both;
    width: 100%;
    max-width: 970px;
    margin: 28px auto 34px;
    text-align: center;
    overflow: hidden;
}

.f40-ad-label {
    margin-bottom: 7px;
    font-size: 12px;
    line-height: 1.2;
    color: #9ca3af;
    text-align: center;
    font-weight: 500;
}

.f40-ad-slot ins.adsbygoogle {
    max-width: 100%;
}

.f40-ad-slot-site_below_header,
.f40-ad-slot-home_before_today,
.f40-ad-slot-home_after_today,
.f40-ad-slot-home_after_tomorrow,
.f40-ad-slot-single_after_hero,
.f40-ad-slot-single_after_where,
.f40-ad-slot-single_before_faq,
.f40-ad-slot-archive_after_intro,
.f40-ad-slot-archive_after_list,
.f40-ad-slot-article_after_intro,
.f40-ad-slot-article_mid_content,
.f40-ad-slot-article_before_end,
.f40-ad-slot-incontent_1 {
    min-height: 90px;
}

.f40-ad-slot-site_below_header {
    margin-top: 18px;
    margin-bottom: 26px;
}

.f40-ad-slot-home_before_today {
    margin-top: 18px;
    margin-bottom: 24px;
}

.f40-ad-slot-home_after_today,
.f40-ad-slot-home_after_tomorrow {
    margin-top: 28px;
    margin-bottom: 32px;
}

.f40-ad-slot-single_after_hero {
    margin-top: 30px;
    margin-bottom: 30px;
}

.f40-ad-slot-single_after_where,
.f40-ad-slot-single_before_faq {
    margin-top: 30px;
    margin-bottom: 34px;
}

.f40-ad-slot-article_after_intro,
.f40-ad-slot-article_mid_content,
.f40-ad-slot-article_before_end {
    margin-top: 28px;
    margin-bottom: 32px;
}

.f40-ad-slot-sidebar_after_featured {
    max-width: 336px;
    min-height: 250px;
    margin: 24px auto;
}

@media (max-width: 768px) {
    .f40-ad-slot {
        max-width: 100%;
        min-height: 90px;
        margin: 22px auto 28px;
    }

    .f40-ad-slot-sidebar_after_featured {
        display: none;
    }
}

/* =========================
   SINGLE PARTIDO: IMAGEN + FICHA
========================= */
.f40-match-media-ficha {
    display: grid;
    grid-template-columns: minmax(260px, 42%) 1fr;
    gap: 28px;
    align-items: start;
    margin: 34px 0 36px;
}

.f40-match-media-ficha.has-no-image {
    display: block;
}

.f40-match-poster-side {
    margin: 0;
}

.f40-match-poster-img {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.f40-match-ficha-box h2 {
    margin-top: 0;
}

@media (max-width: 768px) {
    .f40-match-media-ficha {
        display: block;
        margin: 28px 0 32px;
    }

    .f40-match-poster-side {
        margin: 0 0 24px;
    }
}

/* =========================
   HOME: FALLBACK DE PRÓXIMOS PARTIDOS
========================= */
.f40-home-empty-note {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px;
    margin: 22px 0 24px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.f40-home-empty-note p {
    margin: 0;
}

/* =========================
   HOME: ENLACES ÚTILES SEO
========================= */
.f40-home-quick-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px 16px;
    margin: 22px 0 28px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.f40-home-quick-links-title {
    color: #111827;
    font-weight: 800;
    margin-right: 4px;
}

.f40-home-quick-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #f8fafc;
    color: #1d4ed8;
    font-weight: 800;
    text-decoration: none;
    line-height: 1.2;
}

.f40-home-quick-links a:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

@media (max-width: 768px) {
    .f40-home-quick-links {
        align-items: stretch;
    }

    .f40-home-quick-links-title {
        width: 100%;
        margin-bottom: 2px;
    }

    .f40-home-quick-links a {
        flex: 1 1 auto;
        justify-content: center;
    }
}


/* =========================
   LIGAS: AVISO CUANDO NO HAY PARTIDOS HOY
========================= */
.f40-league-empty-note {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px;
    margin: 16px 0 24px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.f40-league-empty-note p {
    margin: 0;
}

/* =========================
   FILAS DE PARTIDOS: ELLIPSIS SUAVE EN EQUIPOS LARGOS
   v2.53.4
   Evita que nombres como Vancouver Whitecaps o Borussia Dortmund se monten
   sobre el "vs" o sobre el rival, sin cambiar el acomodo general estable.
========================= */
@media (min-width: 769px) {
    .f40-table .f40-row .f40-teams {
        min-width: 0 !important;
        overflow: hidden !important;
        flex-wrap: nowrap !important;
    }

    .f40-table .f40-row .f40-team-logo {
        flex: 0 0 auto !important;
    }

    .f40-table .f40-row .f40-vs {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    .f40-table .f40-row .f40-team-name {
        display: block !important;
        min-width: 0 !important;
        max-width: clamp(78px, 13vw, 165px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 180px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .f40-table .f40-row .f40-meta a.f40-channel,
    .f40-table .f40-row .f40-meta span.f40-channel {
        max-width: 120px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .f40-table .f40-row {
        gap: 14px !important;
    }

    .f40-table .f40-row .f40-team-name {
        max-width: clamp(70px, 11vw, 135px) !important;
    }

    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 160px !important;
    }
}


/* =========================
   ENTRADAS RELACIONADAS POR ETIQUETAS
   v2.55.27 - estilo igual a Home para secciones y articulos
========================= */
.f40-related-posts {
    clear: both;
    margin: 36px 0 34px;
}

.f40-related-posts > h2 {
    margin: 0 0 22px;
}

.f40-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px 24px;
    align-items: start;
}

.f40-related-post-card {
    margin: 0;
    min-width: 0;
}

.f40-related-post-link {
    display: block;
    color: inherit;
    text-decoration: none !important;
}

.f40-related-posts .f40-related-post-link:hover,
.f40-related-posts .f40-related-post-link:focus,
.f40-related-posts .f40-related-post-link:active,
.f40-related-posts .f40-related-post-link:hover .f40-related-post-title,
.f40-related-posts .f40-related-post-link:focus .f40-related-post-title,
.f40-related-posts .f40-related-post-link:active .f40-related-post-title {
    text-decoration: none !important;
}

.f40-related-post-media {
    display: block;
    width: 100%;
    height: 160px;
    margin-bottom: 11px;
    overflow: hidden;
    background: #f3f4f6;
}

.f40-related-post-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .2s ease, opacity .2s ease;
}

.f40-related-post-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 14px;
    background: #0f172a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}

.f40-related-post-title {
    display: block;
    max-width: 94%;
    margin: 0 auto;
    color: #111827;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
}

.f40-related-post-link:hover .f40-related-post-img {
    transform: scale(1.05);
    opacity: .96;
}

.f40-related-post-link:hover .f40-related-post-title {
    color: #2563eb;
}

@media (max-width: 900px) {
    .f40-related-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 18px;
    }

    .f40-related-post-media {
        height: 150px;
    }
}

@media (max-width: 560px) {
    .f40-related-posts {
        margin: 30px 0 28px;
    }

    .f40-related-posts > h2 {
        margin-bottom: 18px;
    }

    .f40-related-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 14px;
    }

    .f40-related-post-media {
        height: 118px;
    }

    .f40-related-post-title {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.32;
    }
}

@media (max-width: 380px) {
    .f40-related-post-media {
        height: 104px;
    }
}

/* =========================
   TABLAS EDITORIALES EN MÓVIL
   v2.55.29
   Cuando una tabla de artículo tiene dos columnas de hora, evita que ambas
   aparezcan solo como "Hora" en móvil.
========================= */
@media (max-width: 768px) {
    .f40-editorial-table-wrap tbody tr td:nth-child(3)[data-label="Hora"]::before {
        content: "Hora de México" !important;
    }

    .f40-editorial-table-wrap tbody tr td:nth-child(4)[data-label="Hora"]::before {
        content: "Hora de Argentina" !important;
    }
}


/* =========================
   FILAS DE PARTIDOS: PRIORIZAR NOMBRES DE EQUIPOS SOBRE LIGA
   v2.55.30
   En escritorio/tablet, cuando falta espacio, se recorta primero la liga
   para evitar que nombres cortos como Ecuador o Colombia se corten antes.
========================= */
@media (min-width: 769px) {
    .f40-table .f40-row .f40-teams {
        flex: 1 1 360px !important;
        min-width: 260px !important;
    }

    .f40-table .f40-row .f40-meta {
        flex: 0 1 auto !important;
        min-width: 0 !important;
    }

    .f40-table .f40-row .f40-team-name {
        max-width: clamp(96px, 16vw, 190px) !important;
    }

    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 112px !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .f40-table .f40-row .f40-teams {
        flex-basis: 340px !important;
        min-width: 250px !important;
    }

    .f40-table .f40-row .f40-team-name {
        max-width: clamp(92px, 15vw, 170px) !important;
    }

    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 104px !important;
    }
}

@media (min-width: 769px) and (max-width: 980px) {
    .f40-table .f40-row .f40-teams {
        flex-basis: 320px !important;
        min-width: 240px !important;
    }

    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 92px !important;
    }
}


/* =========================
   FILAS DE PARTIDOS: ELLIPSIS CORRECTO EN LIGA
   v2.55.31
   Mantiene el recorte primero en la liga, pero evita que se corte desde el centro.
   Ejemplo esperado: "Amistosos In..." en lugar de "stosos Internacion".
========================= */
@media (min-width: 769px) {
    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        display: inline-block !important;
        box-sizing: border-box !important;
        max-width: 126px !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        text-align: left !important;
        direction: ltr !important;
        justify-content: flex-start !important;
        vertical-align: middle !important;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 116px !important;
    }
}

@media (min-width: 769px) and (max-width: 980px) {
    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 108px !important;
    }
}


/* =========================
   FILAS DE PARTIDOS: LIGA MÁS CORTA Y ALINEADA
   v2.55.32
   Mantiene prioridad para equipos y deja la liga como chip corto: "Amistosos In...".
========================= */
@media (min-width: 769px) {
    .f40-table .f40-row .f40-meta {
        align-items: center !important;
    }

    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 104px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        align-self: center !important;
        line-height: 1.15 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 100px !important;
    }
}

@media (min-width: 769px) and (max-width: 980px) {
    .f40-table .f40-row .f40-meta a.f40-league,
    .f40-table .f40-row .f40-meta span.f40-league {
        max-width: 96px !important;
    }
}
