/* ==========================================
   MDV · Archivo digital por idioma
   ========================================== */

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

  .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: "Archivo digital en ";
  }

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

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

  /* BANDERA DEL IDIOMA */

  .view-taxonomy-term > .view-header
  .field--name-field-imagen-taxonomia {
    margin: 0 0 16px;
  }

  .view-taxonomy-term > .view-header
  .field--name-field-imagen-taxonomia img {
    display: block;
    width: auto;
    max-width: 48px;
    height: auto;
    max-height: 36px;
    margin: 0;
    border: 0;
    box-shadow: none;
    object-fit: contain;
  }

  /* TARJETAS */

  .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: 22px;
    background: #fff;
    border: 1px solid var(--mdv-borde);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(20, 55, 75, 0.04);
  }

  .view-taxonomy-term .views-row > article {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  /* TÍTULOS */

  .view-taxonomy-term .views-row .node-title,
  .view-taxonomy-term .views-row .node-title a,
  .view-taxonomy-term .views-row .node-title a span {
    margin: 0;
    padding: 0;
    background: transparent !important;
    color: var(--mdv-azul) !important;
    border: 0;
    box-shadow: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
  }

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

  /* DATOS DE REGISTRO */

  .view-taxonomy-term .views-row .node-header {
    margin: 16px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--mdv-borde);
  }

  .view-taxonomy-term .views-row .node-submitted-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    padding: 0;
    color: var(--mdv-suave);
    font-size: 12px;
    line-height: 1.6;
  }

  .view-taxonomy-term .views-row :is(
    .node-user,
    .node-date
  ) {
    float: none;
    margin: 0;
    padding: 0;
  }

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

  /* 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;
    box-sizing: border-box;
    min-width: 42px;
    min-height: 42px;
    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);
  }

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

  /* MÓVIL */

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

    .view-taxonomy-term > .view-content > .views-row {
      padding: 18px;
    }
  }
}
/* ==========================================
   Tarjetas: portada izquierda y datos derecha
   ========================================== */

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

  /* Ocultar autor y fecha solo en este listado */

  .view-taxonomy-term .views-row
  > article.node-type-documento-del-archivo
  > .node-header {
    display: none;
  }

  /* Separación bajo el título */

  .view-taxonomy-term .views-row
  > article.node-type-documento-del-archivo
  > .node-title {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dce5eb;
  }

  /* Portada y datos */

  .view-taxonomy-term .views-row
  > article.node-type-documento-del-archivo
  > .node-content {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 14px 22px;
    align-content: start;
    align-items: start;
    margin: 0;
    padding: 0;
  }

  .view-taxonomy-term .views-row
  > article.node-type-documento-del-archivo
  > .node-content::before,
  .view-taxonomy-term .views-row
  > article.node-type-documento-del-archivo
  > .node-content::after {
    display: none;
  }

  /* Todos los datos a la derecha */

  .view-taxonomy-term .views-row
  article.node-type-documento-del-archivo
  > .node-content > * {
    grid-column: 2;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  /* Portada a la izquierda */

  .view-taxonomy-term .views-row
  article.node-type-documento-del-archivo
  > .node-content > .field--name-field-image {
    grid-column: 1;
    grid-row: 1 / span 20;
  }

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

  /* Etiquetas */

  .view-taxonomy-term .views-row .node-content :is(
    .field__label,
    .field-label-above,
    .node-taxonomy-container > h4
  ) {
    margin: 0 0 5px;
    padding: 0;
    color: #627066;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
  }

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

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

  .view-taxonomy-term .views-row .node-content a {
    color: #054b81;
    text-decoration: none;
  }

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

  /* Móvil */

  @media (max-width: 480px) {
    .view-taxonomy-term .views-row
    > article.node-type-documento-del-archivo
    > .node-content {
      grid-template-columns: 100px minmax(0, 1fr);
      gap: 12px 16px;
    }
  }
}
/* Tarjetas compactas, sin filas vacías */

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

  .view-taxonomy-term > .view-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }

  .view-taxonomy-term > .view-content > .views-row {
    padding: 18px;
    min-height: 0;
  }

  .view-taxonomy-term .views-row
  > article.node-type-documento-del-archivo
  > .node-content {
    display: flow-root;
  }

  .view-taxonomy-term .views-row
  article.node-type-documento-del-archivo
  > .node-content > * {
    margin: 0 0 12px 138px;
  }

  .view-taxonomy-term .views-row
  article.node-type-documento-del-archivo
  > .node-content > .field--name-field-image {
    float: left;
    width: 120px;
    margin: 0 18px 0 0;
  }

  .view-taxonomy-term .views-row
  .field--name-field-image img {
    max-width: 120px;
    max-height: 150px;
  }

  @media (max-width: 1050px) {
    .view-taxonomy-term > .view-content {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

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