/*
 * Comuniate - estilos comunes de las páginas individuales de partido
 * Usado por: partido_previa.php, partido_confirmados.php y partido_puntos_nuevo.php
 */

/* Utilidades extraídas de estilos inline de las plantillas */
.cm-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.cm-no-space {
    margin: 0;
    padding: 0;
}

.cm-loader-pad {
    padding: 10px;
}

.cm-tv-label {
    margin-right: 4px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.cm-suspended-wrap {
    margin: 20px;
}

.cm-mt-15 {
    margin-top: 15px;
}

.cm-mt-20 {
    margin-top: 20px;
}

.cm-mb-30 {
    margin-bottom: 30px;
}

.cm-my-10 {
    margin-top: 10px;
    margin-bottom: 10px;
}

.cm-lineup-col {
    margin: 0;
    padding: 5px;
}

.cm-seo-row {
    margin-top: 18px;
}

.cm-seo-copy {
    font-size: 14px;
    line-height: 1.7;
}

.cm-field-head-bg {
    background-color: #008b46;
}

.cm-field-head-text {
    margin-right: 10px;
    color: #fff;
    font-size: 16px;
    line-height: 25px;
    text-align: center;
}

.cm-squad-cell {
    font-size: 12px;
    line-height: 1.7;
}

.cm-player-link {
    border-bottom: 2px solid #666;
}

.cm-home-icon {
    float: left;
    font-size: 24px;
}

.cm-menu-fantasy-hidden {
    display: none;
    margin: 10px 0 15px;
}

.cm-login-border {
    border-color: #5cb85c;
}

.cm-promo-image {
    min-height: 201px;
    max-height: 321px;
    margin-top: 5px;
    margin-bottom: 5px;
    border-radius: 15px 0 15px 0;
}

/* Contexto indexable de clasificación, estadísticas y H2H */
.cm-match-context {
    margin: 18px 0 4px;
}

.cm-match-context__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.cm-match-context__card {
    padding: 13px;
    border: 1px solid #e7ebef;
    border-radius: 12px;
    background: #fff;
}

.cm-match-context__team {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.cm-match-context__team img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.cm-match-context__team strong {
    font-size: 15px;
}

.cm-match-context__pos {
    margin-top: 2px;
    color: #6b7280;
    font-size: 13px;
}

.cm-match-context__metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    text-align: center;
}

.cm-match-context__metric {
    padding: 7px 4px;
    border-radius: 8px;
    background: #f7f8fa;
}

.cm-match-context__metric b {
    display: block;
    font-size: 15px;
}

.cm-match-context__metric span {
    display: block;
    color: #6b7280;
    font-size: 10px;
    text-transform: uppercase;
}

.cm-match-context__note {
    margin: 9px 0 0;
    font-size: 13px;
    line-height: 1.6;
}

.cm-match-context__h2h {
    margin-top: 22px;
}

.cm-match-context__h2h-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.cm-match-context__h2h-heading {
    flex: 1 1 auto;
    margin-bottom: 0 !important;
}

.cm-match-context__h2h-sub {
    flex: 0 0 auto;
    padding-bottom: 7px;
    color: #7b8490;
    font-size: 12px;
    white-space: nowrap;
}

/* Desktop: dos enfrentamientos por fila */
.cm-match-context__h2h-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cm-match-context__h2h-item {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Si hay un número impar, la última tarjeta queda centrada a media anchura */
.cm-match-context__h2h-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 5px);
    justify-self: center;
}

.cm-match-context__h2h-link {
    display: block;
    height: 100%;
    padding: 10px 11px;
    border: 1px solid #e7ebef;
    border-radius: 11px;
    background: #fff;
    text-decoration: none !important;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.cm-match-context__h2h-link:hover {
    border-color: #d9dfe6;
    background: #fafbfc;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .07);
    transform: translateY(-1px);
}

.cm-match-context__h2h-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.cm-match-context__season {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 999px;
    background: #f1f4f7;
    color: #4b5563;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .02em;
}

.cm-match-context__date {
    color: #8a949f;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.cm-match-context__h2h-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
}

.cm-match-context__h2h-team {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #25313d;
    font-size: 12px;
    font-weight: 700;
}

.cm-match-context__h2h-team--home {
    justify-content: flex-end;
    text-align: right;
}

.cm-match-context__h2h-team--away {
    justify-content: flex-start;
    text-align: left;
}

.cm-match-context__h2h-team img {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.cm-match-context__h2h-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cm-match-context__score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 50px;
    padding: 7px 5px;
    border-radius: 8px;
    background: #18212b;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.cm-match-context__score-sep {
    font-size: 11px;
    opacity: .55;
}

.cm-match-context__more {
    margin-top: 8px;
    font-size: 13px;
}

.cm-match-context__more a {
    font-weight: 700;
}

@media (max-width: 767px) {
    .cm-match-context__grid {
        grid-template-columns: 1fr;
    }

    .cm-match-context__metrics {
        grid-template-columns: repeat(3, 1fr);
    }

    .cm-match-context__h2h-head {
        display: block;
    }

    .cm-match-context__h2h-heading {
        margin-bottom: 0 !important;
    }

    .cm-match-context__h2h-sub {
        padding: 5px 0 0;
        white-space: normal;
    }

    .cm-match-context__h2h-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cm-match-context__h2h-item:last-child:nth-child(odd) {
        grid-column: auto;
        width: 100%;
    }

    .cm-match-context__h2h-link {
        padding: 9px;
    }

    .cm-match-context__h2h-match {
        grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
        gap: 5px;
    }

    .cm-match-context__h2h-team {
        gap: 5px;
        font-size: 12px;
    }

    .cm-match-context__h2h-team img {
        flex-basis: 21px;
        width: 21px;
        height: 21px;
    }

    .cm-match-context__score {
        min-width: 52px;
        padding: 6px 5px;
        font-size: 14px;
    }
}
