/* ==================================================
   ARGENTOMÁTICA — ESTILO GLOBAL PARA ARTÍCULOS
   ================================================== */

.am-article {
  --am-bg: #0b1220;
  --am-panel: #111827;
  --am-text: #e5e7eb;
  --am-muted: #a9b4c5;
  --am-border: rgba(255, 255, 255, 0.12);
  --am-blue: #38bdf8;
  --am-violet: #8b5cf6;
  --am-yellow: #facc15;
  --am-red: #fb7185;

  color: var(--am-text);
  background: linear-gradient(180deg, #0b1220, #101827);
  border: 1px solid var(--am-border);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 42px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  line-height: 1.72;
}

.am-article * {
  box-sizing: border-box;
}

.am-article h1,
.am-article h2,
.am-article h3 {
  color: #ffffff;
  line-height: 1.2;
  margin-top: 1.7em;
  margin-bottom: 0.65em;
}

.am-article h1 {
  margin-top: 0;
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.03em;
}

.am-article h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--am-border);
}

.am-article h3 {
  font-size: clamp(19px, 2.6vw, 24px);
}

.am-article p,
.am-article li {
  color: var(--am-text);
}

.am-article a {
  color: var(--am-blue);
}

.am-lead {
  font-size: 1.15rem;
  color: #f3f4f6 !important;
}

/* Cabecera del artículo */

.am-hero {
  padding: clamp(24px, 5vw, 44px);
  margin: -2px -2px 32px;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 80% 15%,
      rgba(139, 92, 246, 0.35),
      transparent 36%
    ),
    radial-gradient(
      circle at 10% 90%,
      rgba(56, 189, 248, 0.24),
      transparent 42%
    ),
    linear-gradient(135deg, #101827, #0b1220);
  border: 1px solid var(--am-border);
}

/* Etiquetas superiores */

.am-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.am-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid var(--am-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
  font-size: 0.88rem;
  font-weight: 700;
}

/* Avisos */

.am-callout {
  margin: 24px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--am-blue);
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  color: #e0f2fe;
}

.am-callout.warning {
  border-left-color: var(--am-yellow);
  background: rgba(250, 204, 21, 0.09);
  color: #fef3c7;
}

.am-callout.danger {
  border-left-color: var(--am-red);
  background: rgba(251, 113, 133, 0.09);
  color: #ffe4e6;
}

/* Comandos con botón Copiar */

.am-codebox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 22px;
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  background: #070d18;
}

.am-codebox code {
  flex: 1;
  min-width: 0;
  color: #d8f5ff;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 1rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.am-copy {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px 14px;
  background: linear-gradient(
    135deg,
    var(--am-blue),
    var(--am-violet)
  );
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.am-copy:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.am-copy:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.35);
  outline-offset: 2px;
}

/* Pasos numerados */

.am-steps {
  counter-reset: am-step;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.am-steps > li {
  counter-increment: am-step;
  position: relative;
  margin: 12px 0;
  padding: 15px 16px 15px 54px;
  border: 1px solid var(--am-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.am-steps > li::before {
  content: counter(am-step);
  position: absolute;
  top: 13px;
  left: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--am-blue),
    var(--am-violet)
  );
  color: #ffffff;
  font-weight: 900;
}

/* Rutas y menús */

.am-route {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.08);
  font-family: Consolas, Monaco, "Courier New", monospace;
  color: #ede9fe;
  overflow-wrap: anywhere;
}

/* Imágenes */

.am-shot {
  margin: 28px 0;
}

.am-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--am-border);
}

.am-shot figcaption {
  margin-top: 9px;
  color: var(--am-muted);
  font-size: 0.92rem;
  text-align: center;
}

/* Espacio opcional para imágenes pendientes */

.am-shot-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 2px dashed rgba(139, 92, 246, 0.6);
  border-radius: 16px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(139, 92, 246, 0.055),
      rgba(139, 92, 246, 0.055) 14px,
      rgba(56, 189, 248, 0.035) 14px,
      rgba(56, 189, 248, 0.035) 28px
    );
  text-align: center;
  color: #d8b4fe;
  font-weight: 800;
}

/* Listas */

.am-list {
  margin: 18px 0 26px;
  padding-left: 22px;
}

.am-list li {
  margin: 8px 0;
}

/* Vídeos */

.am-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 26px 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--am-border);
  background: #070d18;
}

.am-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Preguntas frecuentes */

.am-faq details {
  margin: 12px 0;
  padding: 15px 16px;
  border: 1px solid var(--am-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.am-faq summary {
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.am-faq details p {
  margin-bottom: 0;
}

/* Nota final */

.am-footer-note {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--am-border);
  color: var(--am-muted);
  font-size: 0.95rem;
}

/* Adaptación para móviles */

@media (max-width: 620px) {
  .am-article {
    border-radius: 14px;
    padding: 18px;
  }

  .am-codebox {
    align-items: stretch;
    flex-direction: column;
  }

  .am-copy {
    width: 100%;
  }

  .am-shot-placeholder {
    min-height: 170px;
  }
}

/* Compatibilidad con ArgentoMática 1.3.1.
   Mantiene las clases del contenido y evita estilos duplicados del tema. */
.entry-content:has(> .am-article:only-child) {
  padding: 0;
  background: transparent;
}

.entry-content .am-article {
  min-width: 0;
  padding: clamp(18px, 2.5vw, 32px);
  overflow-wrap: anywhere;
}

.entry-content .am-article :is(h1, h2, h3) {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
}

.am-article :is(ul.am-list, ul:not([class])) {
  list-style: disc;
  padding-inline-start: 1.5em;
}

.am-article :is(ol.am-list, ol:not([class])) {
  list-style: decimal;
  padding-inline-start: 1.5em;
}

.am-article .am-steps {
  list-style: none;
  padding: 0;
}

.am-article .am-codebox {
  min-width: 0;
}

.am-article .am-codebox code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.am-article .am-codebox pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  white-space: pre-wrap;
}

.am-article .am-copy,
.am-article .am-steps > li::before {
  color: #070d18;
}

.am-article .am-copy {
  min-height: 44px;
}

.am-article .am-copy:hover {
  opacity: 1;
}

.am-article .am-copy:focus-visible,
.am-article .am-faq summary:focus-visible {
  outline: 3px solid var(--am-blue);
  outline-offset: 4px;
}

.am-article .am-callout :is(p, li) {
  color: inherit;
}

.am-article .am-footer-note,
.am-article .am-footer-note p {
  color: var(--am-muted);
}

.am-article .am-shot img {
  margin: 0;
}

.am-article :is(table, pre, .wp-block-table) {
  max-width: 100%;
  overflow-x: auto;
}

.am-article table {
  display: block;
}

.entry-content .am-video iframe {
  height: 100%;
}

.am-article .am-faq summary {
  min-height: 44px;
  align-content: center;
}

@media (max-width: 620px) {
  .entry-content .am-article {
    padding: 18px;
  }

  .am-article .am-hero {
    padding: 16px;
    margin-bottom: 24px;
  }

  .am-article :is(.am-callout, .am-route) {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .am-article .am-copy {
    transition: none;
  }

  .am-article .am-copy:hover {
    transform: none;
  }
}
