/* ==========================================
   MDV · Juegos por número de jugadores
   Encabezado, tarjetas y paginación
   ========================================== */

@scope (html:has(
  link[rel="canonical"][href*="/numjugadores/"]
)) {

  .view-taxonomy-term {
    --mdv-texto: #27382e;
    --mdv-azul: #054b81;
    --mdv-suave: #627066;
    --mdv-borde: #dce5eb;

    color: var(--mdv-texto);
  }

  /* ENCABEZADO */

  .view-taxonomy-term .mdv-titulo-catalogo {
    display: block;
    margin: 0 0 24px;
    padding: 0 0 14px;
    background: transparent;
    color: var(--mdv-texto);
    border: 0;
    border-bottom: 2px solid var(--mdv-azul);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(26px, 3.5vw, 36px);
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
  }

  .view-taxonomy-term .mdv-titulo-catalogo::before {
    content: "Juegos para ";
  }

  .view-taxonomy-term .mdv-titulo-catalogo::after {
    content: " jugadores";
  }

  .view-taxonomy-term .mdv-titulo-catalogo
  .mdv-encabezado-publicadora,
  .view-taxonomy-term .mdv-titulo-catalogo
  .mdv-encabezado-desarrolladora {
    display: none !important;
  }

  /* RECUENTO */

  .view-taxonomy-term > .view-header {
    margin-bottom: 24px;
    padding-bottom: 0;
    border: 0;
    color: var(--mdv-suave);
    font-size: 14px;
    line-height: 1.6;
  }

  /* DOS TARJETAS POR FILA */

  .view-taxonomy-term > .view-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .view-taxonomy-term > .view-content::before,
  .view-taxonomy-term > .view-content::after {
    display: none;
  }

  .view-taxonomy-term > .view-content > .views-row {
    float: none;
    box-sizing: border-box;
    width: auto !important;
    min-width: 0;
    margin: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--mdv-borde);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(20, 55, 75, 0.04);
  }

  /* DISTRIBUCIÓN INTERIOR */

  .view-taxonomy-term .views-row > .ds-3col-stacked-fluid {
    display: grid;
    grid-template-columns:
      120px
      minmax(0, 1fr)
      minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin: 0;
  }

  .view-taxonomy-term .views-row > .ds-3col-stacked-fluid::before,
  .view-taxonomy-term .views-row > .ds-3col-stacked-fluid::after {
    display: none;
  }

  .view-taxonomy-term .views-row > .ds-3col-stacked-fluid > div {
    float: none;
    box-sizing: border-box;
    width: auto !important;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  .view-taxonomy-term .views-row
  > .ds-3col-stacked-fluid > .group-header {
    grid-column: 1 / -1;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mdv-borde);
  }

  /* TÍTULOS DE LOS JUEGOS */

  .view-taxonomy-term .views-row .group-header :is(
    .titulo_nodo_white,
    h2
  ) {
    display: block;
    margin: 0;
    padding: 0;
    background: transparent !important;
    color: var(--mdv-azul) !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  .view-taxonomy-term .views-row .group-header a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  /* CARÁTULAS */

  .view-taxonomy-term .views-row .group-left {
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .view-taxonomy-term .views-row .group-left img {
    display: block;
    float: none;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 150px;
    margin: 0 auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    object-fit: contain;
  }

  /* ETIQUETAS */

  .view-taxonomy-term .views-row :is(
    .field-label-above,
    .field__label,
    .node-taxonomy-container > h4
  ) {
    margin: 0 0 9px;
    padding: 0;
    color: var(--mdv-suave);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
  }

  .view-taxonomy-term .views-row
  .node-taxonomy-container > h4 i {
    display: none;
  }

  /* ICONOS */

  .view-taxonomy-term .views-row .taxonomy-term.row {
    margin: 0;
  }

  .view-taxonomy-term .views-row .taxonomy-term .bs-region {
    float: none;
    width: 100%;
    padding: 0;
  }

  .view-taxonomy-term .views-row .taxonomy-term img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
  }

  /* AÑO */

  .view-taxonomy-term .views-row .field--name-field-ano-juego {
    margin-top: 18px;
  }

  .view-taxonomy-term .views-row .taxonomy-terms,
  .view-taxonomy-term .views-row .taxonomy-terms li {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .view-taxonomy-term .views-row .taxonomy-terms a {
    color: var(--mdv-azul);
    font-size: 15px;
    line-height: 1.5;
    text-decoration: none;
  }

  .view-taxonomy-term .views-row .taxonomy-terms a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* PAGINACIÓN */

  .view-taxonomy-term .pager {
    margin-top: 28px;
  }

  .view-taxonomy-term .pager__items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .view-taxonomy-term .pager__item {
    margin: 0;
    padding: 0;
  }

  .view-taxonomy-term .pager__item a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 42px;
    min-height: 42px;
    box-sizing: border-box;
    padding: 8px 12px;
    background: #fff;
    color: var(--mdv-azul);
    border: 1px solid var(--mdv-borde);
    border-radius: 8px;
    text-decoration: none;
  }

  .view-taxonomy-term .pager__item.is-active a {
    background: var(--mdv-azul);
    color: #fff;
    border-color: var(--mdv-azul);
  }

  /* NAVEGACIÓN CON TECLADO */

  .view-taxonomy-term a:focus-visible {
    outline: 3px solid #277da8;
    outline-offset: 4px;
  }

  /* TABLET */

  @media (max-width: 900px) {
    .view-taxonomy-term > .view-content {
      grid-template-columns: 1fr;
    }
  }

  /* MÓVIL */

  @media (max-width: 480px) {
    .view-taxonomy-term > .view-content > .views-row {
      padding: 15px;
    }

    .view-taxonomy-term .views-row > .ds-3col-stacked-fluid {
      grid-template-columns:
        90px
        minmax(0, 1fr)
        minmax(0, 1fr);
      gap: 12px;
    }

    .view-taxonomy-term .views-row .group-header :is(
      .titulo_nodo_white,
      h2
    ) {
      font-size: 17px;
    }
  }
}

/* SINGULAR: 1 JUGADOR */

html:has(
  link[rel="canonical"][href$="/numjugadores/1"],
  link[rel="canonical"][href$="/numjugadores/1/"]
) .view-taxonomy-term .mdv-titulo-catalogo::after {
  content: " jugador";
}