/*
  AME - shared/utilidades.css
  Clases pequenas para estilos repetidos dentro del contenido.
*/

.u-text-justify {
  text-align: justify;
}

.u-text-center {
  text-align: center;
}

.u-link-primary {
  color: var(--azul-principal);
  text-decoration: none;
}

.ame-academy-document-link {
  text-decoration: none !important;
}

.ame-academy-document-link.has-document {
  cursor: pointer;
}

.ame-academy-document-link.is-unavailable {
  cursor: default;
}

.ame-academy-document-link.is-unavailable:hover,
.ame-academy-document-link.is-unavailable:focus {
  background: transparent !important;
  color: var(--azul-principal);
  text-decoration: none !important;
}

.ame-pdf-marker {
  display: inline-block;
  margin-left: 6px;
  color: #6b7280;
  font-size: 0.68em;
  line-height: 1;
  vertical-align: super;
}

.uni-academias-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 22px;
  border: none;
  border-radius: 6px;
  background-color: #004A98;
  color: #fff;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.uni-academias-btn:hover,
.uni-academias-btn:focus {
  background-color: #00b2e3;
  color: #fff;
  text-decoration: none;
}

.ame-attribute-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.puntos:has(> li > .ame-attribute-actions),
details ol:has(> li > .ame-attribute-actions),
ol.u-text-justify:has(> .ame-attribute-heading-row) {
  counter-reset: ame-attribute;
}

.puntos > li:has(> .ame-attribute-actions),
details ol > li:has(> .ame-attribute-actions) {
  counter-increment: ame-attribute;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #e1e8f0;
  border-left: 6px solid #004A98;
  border-radius: 6px;
  background: #f7fbff;
  box-shadow: 0 3px 10px rgba(0, 74, 152, 0.05);
  list-style: none;
}

.puntos > li:has(> .ame-attribute-actions)::before,
details ol > li:has(> .ame-attribute-actions)::before {
  content: "AE " counter(ame-attribute);
  position: static;
  left: auto;
  top: auto;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  width: auto;
  padding: 0;
  border-radius: 6px;
  color: #004A98;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.puntos > li:has(> .ame-attribute-actions)::after,
details ol > li:has(> .ame-attribute-actions)::after {
  content: none;
}

.puntos > li:has(> .ame-attribute-actions) > .ame-attribute-actions,
details ol > li:has(> .ame-attribute-actions) > .ame-attribute-actions,
.ame-attribute-heading-row > .ame-attribute-actions {
  grid-column: 3;
  justify-content: flex-end;
  margin-top: 0;
}

.ame-attribute-heading-row {
  counter-increment: ame-attribute;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
  margin: 18px 0 12px;
  padding: 14px 16px;
  border: 1px solid #e1e8f0;
  border-left: 6px solid #004A98;
  border-radius: 6px;
  background: #f7fbff;
  box-shadow: 0 3px 10px rgba(0, 74, 152, 0.05);
}

.ame-attribute-heading-row::before {
  content: "Atributo " counter(ame-attribute);
  align-self: center;
  justify-self: center;
  padding: 0;
  border-radius: 6px;
  color: #004A98;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.ame-attribute-heading-row > strong {
  align-self: center;
}

.ame-attribute-actions-final {
  justify-content: center;
  margin: 16px 0 4px;
}

.ame-attribute-document-btn {
  border: 1px solid transparent;
  min-width: 188px;
  white-space: nowrap;
}

.ame-attribute-document-btn.is-unavailable {
  border-color: #d1d5db;
  background: #edf1f5 !important;
  color: #667085 !important;
  cursor: not-allowed;
}

.ame-attribute-document-btn.is-unavailable:hover,
.ame-attribute-document-btn.is-unavailable:focus {
  border-color: #d1d5db;
  background: #edf1f5 !important;
  color: #667085 !important;
}

@media (max-width: 768px) {
  .puntos > li:has(> .ame-attribute-actions),
  details ol > li:has(> .ame-attribute-actions),
  .ame-attribute-heading-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .puntos > li:has(> .ame-attribute-actions) > .ame-attribute-actions,
  details ol > li:has(> .ame-attribute-actions) > .ame-attribute-actions,
  .ame-attribute-heading-row > .ame-attribute-actions {
    grid-column: 1;
    justify-content: flex-start;
  }

  .ame-attribute-document-btn {
    min-width: 0;
    white-space: normal;
  }
}
