/*
|--------------------------------------------------------------------------
| Page Meta
|--------------------------------------------------------------------------
| Estilos exclusivos de /meta/
|--------------------------------------------------------------------------
*/

.ts-meta-page {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 80px;
}

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

.ts-meta-page__header {
    max-width: 760px;
    margin-bottom: 42px;
}

.ts-meta-page__eyebrow {
    margin: 0 0 10px;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ts-meta-page__title {
    margin: 0;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.ts-meta-page__description {
    margin: 18px 0 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.7;
}

/* ==========================================================================
   FILTROS
   ========================================================================== */

.ts-meta-page__filters {
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.ts-meta-page__filters form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
}

.ts-meta-page__filter {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ts-meta-page__filter label {
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.ts-meta-page__filter select {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    cursor: pointer;
}

.ts-meta-page__filter select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    outline-offset: 1px;
    border-color: #2563eb;
}

.ts-meta-page__filters button {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ts-meta-page__filters button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   CONTEXTO
   ========================================================================== */

.ts-meta-page__context {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 56px;
}

.ts-meta-page__context-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.ts-meta-page__label {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.ts-meta-page__value {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.3;
}

/* ==========================================================================
   META RANKING
   ========================================================================== */

.ts-meta-ranking {
    margin-top: 0;
}

.ts-meta-ranking__header {
    margin-bottom: 24px;
}

.ts-meta-ranking__header h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ts-meta-ranking__header p {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
}

.ts-meta-page .meta-ranking {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-meta-page .ranking-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "pokemon usage"
        "roles roles";
    align-items: center;
    gap: 16px;
    min-width: 0;
    margin: 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ts-meta-page .ranking-row:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.ts-meta-page .ranking-row > a {
    grid-area: pokemon;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    color: #0f172a;
    font-size: 17px;
    font-weight: 650;
    text-decoration: none;
}

.ts-meta-page .ranking-row > a:hover .pokemon-name {
    color: #2563eb;
}

.ts-meta-page .rank-number {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
}

.ts-meta-page .pokemon-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.ts-meta-page .usage {
    grid-area: usage;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* ==========================================================================
   ROLES
   ========================================================================== */

.ts-meta-page .pokemon-roles {
    grid-area: roles;
    min-width: 0;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.ts-meta-page .pokemon-roles__label {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.ts-meta-page .pokemon-role {
    margin: 0;
    padding: 5px 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.ts-meta-page .pokemon-role + .pokemon-role {
    border-top: 1px solid #f8fafc;
}

/* ==========================================================================
   ESTADO VACÍO
   ========================================================================== */

.ts-meta-page .ts-meta-empty {
    margin: 0;
    padding: 28px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {

    .ts-meta-page .meta-ranking {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 700px) {

    .ts-meta-page {
        width: min(100% - 28px, 1200px);
        padding: 44px 0 60px;
    }

    .ts-meta-page__header {
        margin-bottom: 32px;
    }

    .ts-meta-page__filters form {
        grid-template-columns: 1fr;
    }

    .ts-meta-page__filters button {
        width: 100%;
    }

    .ts-meta-page__context {
        grid-template-columns: 1fr;
        margin-bottom: 42px;
    }

}

@media (max-width: 480px) {

    .ts-meta-page {
        width: min(100% - 24px, 1200px);
        padding-top: 36px;
    }

    .ts-meta-page__filters {
        padding: 18px;
    }

    .ts-meta-page .ranking-row {
        padding: 16px;
        gap: 12px;
    }

    .ts-meta-page .ranking-row > a {
        font-size: 16px;
    }

    .ts-meta-page .usage {
        min-width: 64px;
        font-size: 12px;
    }

}


/* ==========================================================================
   META — DETALLE COMPETITIVO POR POKÉMON
   ========================================================================== */

/*
 * El ranking ahora contiene un bloque completo por Pokémon.
 * Las secciones internas deben ocupar todo el ancho de la tarjeta,
 * evitando que el grid original del ranking las coloque en columnas
 * independientes.
 */

.ts-meta-page .ranking-row > .ts-meta-pokemon__section {
    grid-column: 1 / -1;
    grid-area: auto;
    min-width: 0;
    margin: 10px 0 0;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.ts-meta-page .ranking-row > .ts-meta-pokemon__section:first-of-type {
    margin-top: 14px;
}

/* Encabezados de sección */

.ts-meta-page .ts-meta-pokemon__section-header {
    margin: 0 0 18px;
}

.ts-meta-page .ts-meta-pokemon__section-kicker {
    margin: 0 0 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ts-meta-page .ts-meta-pokemon__section-header h3,
.ts-meta-page .ts-pokedex-section-title {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   DATOS COMPETITIVOS
   -------------------------------------------------------------------------- */

.ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 8px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #f8fafc;
}

.ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-item > .ts-single-pokemon__meta-label:first-child {
    flex: 1 0 100%;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-value {
    min-width: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-item > .ts-single-pokemon__meta-label:not(:first-child) {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-value:hover {
    color: #2563eb;
}

/* --------------------------------------------------------------------------
   EFECTIVIDAD DE TIPOS
   -------------------------------------------------------------------------- */

.ts-meta-page .ts-meta-pokemon__section.ts-pokedex-effectiveness {
    margin-top: 10px;
}

.ts-meta-page .ts-pokedex-effectiveness__group {
    margin: 0 0 20px;
}

.ts-meta-page .ts-pokedex-effectiveness__group:last-child {
    margin-bottom: 0;
}

.ts-meta-page .ts-pokedex-effectiveness__group-title {
    margin: 0 0 10px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.ts-meta-page .ts-pokedex-effectiveness__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.ts-meta-page .ts-pokedex-effectiveness__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    background: #ffffff;
}

.ts-meta-page .ts-pokedex-effectiveness__type {
    min-width: 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.ts-meta-page .ts-pokedex-effectiveness__multiplier {
    flex: 0 0 auto;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   ROLES
   -------------------------------------------------------------------------- */

.ts-meta-page .ts-meta-pokemon__roles .pokemon-roles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 18px;
    grid-area: auto;
    padding: 0;
    border-top: 0;
}

.ts-meta-page .ts-meta-pokemon__roles .pokemon-role {
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid #eef2f7;
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
}

.ts-meta-page .ts-meta-pokemon__roles .pokemon-role + .pokemon-role {
    border-top: 1px solid #eef2f7;
}

/* --------------------------------------------------------------------------
   ALIADOS MÁS COMUNES
   -------------------------------------------------------------------------- */

.ts-meta-page .ts-meta-pokemon__core-partners-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 0;
}

.ts-meta-page .ts-meta-pokemon__core-partner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #f8fafc;
    color: #2563eb;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
}

.ts-meta-page .ts-meta-pokemon__core-partner:hover {
    border-color: #bfdbfe;
    background: #ffffff;
    color: #1d4ed8;
}

.ts-meta-page .ts-meta-pokemon__core-partner-name {
    display: block;
    color: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.ts-meta-page .ts-meta-pokemon__core-partner-explanation {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

/* ==========================================================================
   META — RESPONSIVE DEL DETALLE
   ========================================================================== */

@media (max-width: 700px) {

    .ts-meta-page .ranking-row > .ts-meta-pokemon__section {
        margin-top: 8px;
        padding-top: 22px;
    }

    .ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .ts-meta-page .ts-pokedex-effectiveness__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ts-meta-page .ts-meta-pokemon__roles .pokemon-roles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 14px;
    }

}

@media (max-width: 480px) {

    .ts-meta-page .ranking-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "pokemon usage"
            "details details";
        align-items: start;
    }

    .ts-meta-page .ranking-row > .ts-meta-pokemon__section {
        grid-column: 1 / -1;
        margin-top: 8px;
        padding-top: 20px;
    }

    .ts-meta-page .ts-meta-pokemon__section-header {
        margin-bottom: 14px;
    }

    .ts-meta-page .ts-meta-pokemon__section-header h3,
    .ts-meta-page .ts-pokedex-section-title {
        font-size: 21px;
    }

    .ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-item {
        padding: 11px 12px;
    }

    .ts-meta-page .ts-pokedex-effectiveness__list {
        grid-template-columns: 1fr;
    }

    .ts-meta-page .ts-meta-pokemon__roles .pokemon-roles {
        grid-template-columns: 1fr;
    }

    .ts-meta-page .ts-meta-pokemon__core-partners-list {
        gap: 10px;
    }

    .ts-meta-page .ts-meta-pokemon__core-partner {
        padding: 11px 12px;
    }

}


/* ==========================================================================
   META — DESKTOP V2
   --------------------------------------------------------------------------
   Cada Pokémon contiene un análisis completo. Por eso el ranking utiliza
   una sola columna en escritorio: evita comprimir el contenido en tarjetas
   demasiado estrechas y permite que cada bloque conserve su jerarquía.
   ========================================================================== */

@media (min-width: 901px) {

    .ts-meta-page .meta-ranking {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ts-meta-page .ranking-row {
        padding: 28px;
        gap: 0;
    }

    .ts-meta-page .ranking-row > .ts-meta-pokemon__section {
        margin-top: 22px;
        padding-top: 28px;
    }

    .ts-meta-page .ranking-row > .ts-meta-pokemon__section:first-of-type {
        margin-top: 20px;
    }

    /* Más espacio horizontal permite mostrar los datos sin comprimirlos. */
    .ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }

    .ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-item {
        min-height: 86px;
        padding: 15px 16px;
    }

    .ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta-value {
        font-size: 17px;
    }

    .ts-meta-page .ts-meta-pokemon__roles .pokemon-roles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 24px;
    }

    .ts-meta-page .ts-pokedex-effectiveness__list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }

    .ts-meta-page .ts-meta-pokemon__core-partners-list {
        gap: 12px;
    }
}

/* Tablet: mantener una sola tarjeta por fila, pero reducir la densidad. */
@media (min-width: 701px) and (max-width: 1100px) {

    .ts-meta-page .meta-ranking {
        grid-template-columns: 1fr;
    }

    .ts-meta-page .ts-meta-pokemon__competitive .ts-single-pokemon__meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ts-meta-page .ts-meta-pokemon__roles .pokemon-roles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ts-meta-page .ts-pokedex-effectiveness__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Evitar que una palabra larga rompa la geometría de una celda. */
.ts-meta-page .ts-single-pokemon__meta-item,
.ts-meta-page .ts-pokedex-effectiveness__item,
.ts-meta-page .pokemon-role,
.ts-meta-page .ts-meta-pokemon__core-partner {
    min-width: 0;
    overflow-wrap: anywhere;
}


/* ==========================================================================
   META — ENLACES SIN SUBRAYADO
   --------------------------------------------------------------------------
   Igualar el comportamiento visual de los enlaces de la página Meta con
   la página Competitive: los elementos clickeables mantienen el color
   de enlace, pero no muestran subrayado.
   ========================================================================== */

.ts-meta-page a,
.ts-meta-page a:hover,
.ts-meta-page a:focus,
.ts-meta-page a:active {
    text-decoration: none;
}

.ts-meta-page .ts-meta-pokemon__core-partner,
.ts-meta-page .ts-meta-pokemon__core-partner:hover {
    text-decoration: none;
}


/* ==========================================================================
   META — SELECTOR DE FORMATO
   ========================================================================== */

.ts-meta-page .ts-meta-view-selector {
    display: inline-flex;
    align-items: stretch;
    margin: 0 0 22px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.ts-meta-page .ts-meta-view-selector__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 9px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ts-meta-page .ts-meta-view-selector__link:hover {
    color: #0f172a;
    background: #ffffff;
}

.ts-meta-page .ts-meta-view-selector__link.is-active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.ts-meta-page .ts-meta-view-selector__link:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}


/* ==========================================================================
   META — TIPOS DEL POKÉMON
   ========================================================================== */

.ts-meta-page .ranking-row {
    grid-template-areas:
        "pokemon usage"
        "types types";
}

.ts-meta-page .pokemon-types {
    grid-area: types;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.ts-meta-page .pokemon-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ts-meta-page .pokemon-type:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
    transform: translateY(-1px);
}

.ts-meta-page .pokemon-type:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

.ts-meta-page .ranking-row > .pokemon-types {
    overflow: hidden;
}


/* ==========================================================================
   META — MÓVIL
   ========================================================================== */

@media (max-width: 480px) {

    .ts-meta-page .ts-meta-view-selector {
        display: flex;
        width: 100%;
        margin-bottom: 18px;
    }

    .ts-meta-page .ts-meta-view-selector__link {
        flex: 1 1 50%;
        min-width: 0;
        padding-right: 12px;
        padding-left: 12px;
    }

    .ts-meta-page .pokemon-types {
        gap: 5px;
    }

    .ts-meta-page .pokemon-type {
        min-height: 26px;
        padding: 4px 9px;
        font-size: 11px;
    }
}


/* ==========================================================================
   META — DESKTOP
   ========================================================================== */

@media (min-width: 901px) {

    .ts-meta-page .pokemon-types {
        gap: 7px;
    }

    .ts-meta-page .pokemon-type {
        min-height: 30px;
        padding: 5px 11px;
    }
}


/* ==========================================================================
   META — COMPATIBILIDAD CON EL BLOQUE DE DETALLE
   ========================================================================== */

.ts-meta-page .ranking-row > .ts-meta-pokemon__section {
    grid-column: 1 / -1;
}
