/*
 * Normatividad vigente (pages/normatividad.astro), con el diseño de Contacto: la banda, la tarjeta y su
 * buscador son de components/Banda.astro (estilos/banda.css). Aquí, los filtros, la barra con la cuenta y
 * el orden, y las tarjetas de los documentos (dos columnas desde 1024 px).
 */

.norma-titulo {
  margin-bottom: 16px;
}

/* Filtros: cuatro en un renglón; dos por renglón en pantallas angostas. */
.norma-filtros {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 0;
}

.norma-filtro {
  display: block;
  color: var(--color-azul);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.norma-filtros select,
.norma-orden select {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  margin: 6px 0 0;
  padding: 0 34px 0 12px;
  border: 1px solid #cfd5e3;
  border-radius: var(--radio);
  color: var(--color-azul);
  background-color: #f7f8fb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23151a51' stroke-width='2'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 14px;
  font-size: 14px;
  appearance: none;
}

.norma-filtros select:focus,
.norma-orden select:focus {
  border-color: var(--color-azul);
  outline: 2px solid var(--color-oro);
  outline-offset: 1px;
}

/* Barra sobre la lista: cuenta, «Quitar filtros» y orden. */
.norma-barra {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
}

.norma-cuenta {
  margin: 0;
  color: #4a4f6a;
  font-size: 15px;
}

.norma-cuenta b {
  color: var(--color-azul);
}

.norma-quitar {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--color-azul);
  background: none;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.norma-quitar[hidden],
.norma-vacio[hidden] {
  display: none;
}

.norma-quitar:hover,
.norma-quitar:focus-visible {
  color: var(--color-azul);
  background: none;
  text-decoration-thickness: 2px;
}

.norma-orden {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
  color: var(--color-azul);
  font-size: 13px;
  font-weight: 600;
}

.norma-orden select {
  width: auto;
  margin: 0;
}

/* Documentos */
.norma-lista {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: -16px 0 0;
  padding: 0;
  list-style: none;
}

.norma-doc {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-sizing: border-box;
  height: 100%;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid #e3e6ef;
  border-radius: var(--radio);
  background-color: var(--color-blanco);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.norma-doc[hidden] {
  display: none;
}

.norma-doc:hover {
  border-color: #cfd5e3;
  box-shadow: 0 4px 16px rgb(21 26 81 / 10%);
}

.norma-miniatura {
  flex: none;
  line-height: 0;
}

.norma-miniatura img {
  width: 64px;
  max-width: none;
  height: auto;
  border: 1px solid #e3e6ef;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

.norma-texto {
  min-width: 0;
}

.norma-doc-titulo {
  display: block;
  margin: 0 0 8px;
  color: var(--color-azul);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.norma-doc-titulo:hover,
.norma-doc-titulo:focus-visible {
  color: var(--color-azul);
  text-decoration: underline;
}

.norma-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin: 0;
  color: #626262;
  font-size: 13px;
  line-height: 1.5;
}

.norma-etiqueta {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  color: var(--color-azul);
  background-color: #f6eccb;
  font-size: 12px;
  font-weight: 600;
}

.norma-vacio {
  margin: 0;
  padding: 24px;
  border: 1px dashed #cfd5e3;
  border-radius: var(--radio);
  color: #4a4f6a;
  font-size: 15px;
  text-align: center;
}

@media (max-width: 1023.98px) {
  .norma-filtros {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .norma-lista {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .norma-doc {
    gap: 14px;
    padding: 14px;
  }

  .norma-miniatura img {
    width: 48px;
  }

  .norma-doc-titulo {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .norma-doc {
    transition: none;
  }
}
