/* ==========================================================================
   diseno-articulo.css · familia «articulo» del diseño nuevo: blog (índice y
   entrada), preguntas frecuentes, glosario, desarrolladores, buscador, 404,
   boletín y constructor de widgets (templates/diseno/). Se apoya en sistema.css
   y diseno-lugar.css (.lc, .l-sec, .l-texto, .l-enlaces, .l-faq).
   ========================================================================== */

.ar { min-width: 0; }
.ar-estrecho { max-width: 760px; }
.ar-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.ar-ico-t { display: inline-flex; align-items: center; gap: 10px; }
.ar-ico-t .ico { color: var(--ink-2); }
.ar-enl a { text-decoration: underline; text-decoration-color: var(--senal); text-underline-offset: 3px; }
.ar-vacio { max-width: 60ch; }

/* ---------- Columna de lectura con índice lateral (entrada, FAQ, glosario, API) ---------- */
.ar-art { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e-6); }
.ar-art__cuerpo { min-width: 0; max-width: 760px; }
.ar-indice { display: none; position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
.ar-indice > .rot { margin-bottom: 4px; }
.ar-indice a { display: block; padding: 6px 0 6px 12px; border-inline-start: 2px solid var(--line); text-decoration: none; color: var(--muted); font-size: var(--t-1); line-height: 1.35; }
.ar-indice a:hover { color: var(--ink); border-inline-start-color: var(--ink-2); }
.ar-indice a.ar-indice--aqui { color: var(--ink); border-inline-start-color: var(--senal); }
@media (min-width: 1040px) {
  .ar-art--indice { grid-template-columns: 220px minmax(0, 1fr); }
  .ar-indice { display: grid; gap: 2px; }
  .ar-temas--estrecho, .ar-indice-movil { display: none !important; }
}

/* ---------- Temas (chips) ---------- */
.ar-temas { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-temas .chip { height: 32px; }
.ar-temas .chip .ico { color: var(--muted); }
.ar-temas__n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip--activo .ar-temas__n { color: inherit; opacity: .75; }

/* ---------- Blog: índice ---------- */
.ar-resumen { color: var(--ink-2); line-height: 1.55; max-width: 66ch; text-wrap: pretty; }
.ar-dest { display: grid; gap: var(--e-4); padding-bottom: var(--e-5); border-bottom: 1px solid var(--line); }
.ar-dest__img { display: block; border-radius: var(--r-3); overflow: hidden; background: var(--sunk); aspect-ratio: 1200 / 630; }
.ar-dest__img img, .ar-entrada__img img, .ar-tarjeta__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ar-dest h2 a, .ar-entrada h3 a, .ar-tarjeta h3 a { text-decoration: none; color: var(--ink); }
.ar-dest h2 a:hover, .ar-entrada h3 a:hover, .ar-tarjeta h3 a:hover { text-decoration: underline; text-decoration-color: var(--senal); text-underline-offset: 4px; }
.ar-dest .ar-resumen { font-size: var(--t-3); }
@media (min-width: 900px) {
  .ar-dest { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--e-6); align-items: center; }
}

.ar-lista { list-style: none; margin: 0; padding: 0; max-width: 1080px; }
.ar-lista > li + li { border-top: 1px solid var(--line); }
.ar-entrada { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--e-3) var(--e-4); padding-block: var(--e-4); align-items: start; }
.ar-entrada__f { display: grid; justify-items: start; line-height: 1.15; color: var(--muted); font-size: var(--t-1); padding-top: 2px; }
.ar-entrada__f b { font-family: var(--f-titular); font-variation-settings: "wdth" 84; font-size: var(--t-5); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ar-entrada__t { display: grid; gap: 4px; min-width: 0; }
.ar-entrada__t .tit-4 { font-size: var(--t-4); }
.ar-entrada__img { display: none; }
@media (min-width: 700px) {
  .ar-entrada { grid-template-columns: 72px minmax(0, 1fr) 200px; gap: var(--e-5); }
  .ar-entrada__img { display: block; border-radius: var(--r-2); overflow: hidden; aspect-ratio: 1200 / 630; background: var(--sunk); }
}
.ar-pags { padding-top: var(--e-2); }

/* ---------- Blog: entrada ---------- */
.ar-firma { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: var(--t-1); color: var(--muted); padding-block: var(--e-3); border-block: 1px solid var(--line); }
.ar-portada { margin: 0; border-radius: var(--r-3); overflow: hidden; background: var(--sunk); aspect-ratio: 1200 / 630; }
.ar-portada img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ar-indice-movil { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
.ar-indice-movil summary { cursor: pointer; padding: 10px 14px; font-weight: 600; list-style: none; display: flex; align-items: baseline; gap: 6px; }
.ar-indice-movil summary::-webkit-details-marker { display: none; }
.ar-indice-movil summary::after { content: "+"; color: var(--muted); font-weight: 400; margin-left: auto; }
.ar-indice-movil[open] summary::after { content: "−"; }
.ar-indice-movil ol { margin: 0; padding: 0 14px 12px 2.2em; display: grid; gap: 6px; font-size: var(--t-2); }
.ar-indice-movil a { color: var(--ink-2); }

/* Tipografía de lectura: el texto del artículo viene en HTML de la base de datos */
.ar-prosa { font-size: var(--t-3); line-height: 1.72; color: var(--ink-2); max-width: 68ch; overflow-wrap: break-word; }
.ar-prosa > :first-child { margin-top: 0; }
.ar-prosa p, .ar-prosa ul, .ar-prosa ol, .ar-prosa blockquote, .ar-prosa table, .ar-prosa figure { margin: 0 0 1.1em; }
.ar-prosa h2 { font-family: var(--f-titular); font-variation-settings: "wdth" 88; font-size: var(--t-5); font-weight: 700; line-height: 1.15; letter-spacing: -.015em; color: var(--ink); margin: 1.9em 0 .55em; scroll-margin-top: 80px; text-wrap: balance; }
.ar-prosa h3 { font-family: var(--f-titular); font-variation-settings: "wdth" 92; font-size: var(--t-4); font-weight: 600; line-height: 1.2; color: var(--ink); margin: 1.5em 0 .4em; scroll-margin-top: 80px; }
.ar-prosa h4 { font-size: var(--t-3); font-weight: 600; color: var(--ink); margin: 1.2em 0 .3em; }
.ar-prosa ul, .ar-prosa ol { padding-left: 1.3em; }
.ar-prosa ul { list-style: disc; } .ar-prosa ol { list-style: decimal; }
.ar-prosa li { padding-left: .2em; }
.ar-prosa li + li { margin-top: .45em; }
.ar-prosa li::marker { color: var(--muted); }
.ar-prosa strong, .ar-prosa b { color: var(--ink); font-weight: 600; }
.ar-prosa a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--senal); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ar-prosa a:hover { color: var(--senal-tinta); }
.ar-prosa blockquote { padding: 4px 0 4px 1em; border-inline-start: 3px solid var(--senal); color: var(--ink); font-style: italic; }
.ar-prosa img { max-width: 100%; height: auto; border-radius: var(--r-3); }
.ar-prosa table { display: block; overflow-x: auto; border-collapse: collapse; font-size: var(--t-2); line-height: 1.45; }
.ar-prosa th, .ar-prosa td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.ar-prosa th { background: var(--raised); color: var(--ink); font-weight: 600; }
.ar-prosa hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.ar-prosa code { font-size: .9em; background: var(--sunk); padding: 1px 5px; border-radius: var(--r-1); }

.ar-etiquetas .chip { font-weight: 400; }
.ar-compartir { align-items: center; }
.ar-sec { margin-top: var(--e-2); }
.ar-tarjetas { display: grid; gap: var(--e-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .ar-tarjetas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ar-tarjeta { display: grid; align-content: start; gap: var(--e-3); min-width: 0; }
.ar-tarjeta__img { display: block; border-radius: var(--r-2); overflow: hidden; aspect-ratio: 1200 / 630; background: var(--sunk); }
@media (max-width: 699px) {
  .ar-tarjeta { grid-template-columns: 120px minmax(0, 1fr); align-items: start; }
  .ar-tarjeta .tit-4 { font-size: var(--t-2); }
}

/* ---------- Preguntas frecuentes (también las del widget) ---------- */
.ar-faq summary { line-height: 1.4; }
.ar-faq summary:hover { background: var(--raised); }
.ar-faq details[open] summary { color: var(--ink); }
.ar-faq__r { padding: 0 16px 14px; color: var(--ink-2); max-width: 70ch; line-height: 1.6; }
.ar-faq .ar-faq__r p { padding: 0; margin: 0; }
.ar-faq__r a { text-decoration: underline; text-decoration-color: var(--senal); text-underline-offset: 3px; }
.ar-faq__r code { font-size: .9em; background: var(--sunk); padding: 1px 5px; border-radius: var(--r-1); }
.ar-faq details { scroll-margin-top: 80px; }
.ar-faq details:target summary, .ar-faq details:target { background: var(--senal-suave); }
.ar-faq-acc { justify-content: flex-end; margin-bottom: calc(-1 * var(--e-5)); }

/* ---------- Glosario ---------- */
.ar-gl-busca .busca--grande { max-width: 560px; }
.ar-letras { display: flex; flex-wrap: wrap; gap: 4px; }
.ar-letras a { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); text-decoration: none; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ar-letras a:hover { border-color: var(--ink); }
.ar-terminos { margin: 0; display: grid; }
.ar-termino { display: grid; gap: 4px; padding-block: var(--e-4); scroll-margin-top: 80px; }
.ar-termino + .ar-termino { border-top: 1px solid var(--line); }
.ar-termino:target { background: var(--senal-suave); box-shadow: -10px 0 0 var(--senal-suave), 10px 0 0 var(--senal-suave); }
.ar-termino dt { font-family: var(--f-titular); font-variation-settings: "wdth" 92; font-size: var(--t-4); font-weight: 600; color: var(--ink); position: relative; }
.ar-termino dd { margin: 0; display: grid; gap: var(--e-2); }
.ar-termino dd > p { color: var(--ink-2); line-height: 1.6; max-width: 70ch; }
.ar-termino__a { position: absolute; left: -1.1em; color: var(--faint); text-decoration: none; opacity: 0; font-weight: 400; }
.ar-termino:hover .ar-termino__a, .ar-termino__a:focus-visible { opacity: 1; }
.ar-ancla { position: relative; top: -80px; }
.ar-vivo { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; padding: 10px 12px; border-radius: var(--r-2); background: var(--sunk); color: var(--ink); text-decoration: none; max-width: 70ch; font-size: var(--t-2); line-height: 1.45; }
.ar-vivo:hover { background: var(--senal-suave); }
.ar-vivo__r { height: 24px; color: var(--ok); background: var(--surface); }
.ar-vivo small { display: block; margin-top: 2px; }

/* ---------- Desarrolladores ---------- */
.ar-api { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.ar-api__it { display: grid; gap: 6px; padding: 14px 16px; min-width: 0; }
.ar-api__it + .ar-api__it { border-top: 1px solid var(--line); }
.ar-api__ruta { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ar-api__ruta code, .ar-api__p code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; overflow-wrap: anywhere; color: var(--ink); }
.ar-api__ruta code { font-weight: 600; }
.ar-api__d { color: var(--ink-2); line-height: 1.55; max-width: 72ch; }
.ar-api__d b { color: var(--ink); }
.ar-api__p { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: var(--t-1); color: var(--muted); text-decoration: none; min-width: 0; }
.ar-api__p .ico { align-self: center; color: var(--senal); }
.ar-api__p:hover code { text-decoration: underline; text-decoration-color: var(--senal); }
.ar-metodo { flex: none; font: 600 11px/1 var(--f-texto); letter-spacing: .06em; padding: 4px 6px; border-radius: var(--r-1); background: var(--sunk); color: var(--ok); }
.ar-metodo--post { color: var(--senal-tinta); }

/* ---------- Buscador ---------- */
.ar-busca { align-items: stretch; }
.ar-busca .busca { flex: 1 1 auto; }
.ar-busca__b { height: 56px; }
.ar-res { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.ar-res a { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-2); text-decoration: none; color: var(--ink); min-height: 52px; }
.ar-res a:hover, .ar-res a:focus-visible { background: var(--senal-suave); }
.ar-res a > .ico { color: var(--muted); }
.ar-res__t { min-width: 0; }
.ar-res__t b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.ar-res__t small { display: block; font-size: var(--t-1); color: var(--muted); }
.ar-res__t .ar-res__pais { display: inline; font-weight: 400; margin-left: 4px; }
.ar-res__d { text-align: right; font-size: var(--t-1); color: var(--muted); }
.ar-res__d b { display: block; font-size: var(--t-2); color: var(--ink); white-space: nowrap; }

/* ---------- 404 ---------- */
.ar-404 { max-width: 760px; }
.ar-404__cab { padding-top: var(--e-4); }
.ar-404__n { font-family: var(--f-titular); font-variation-settings: "wdth" 80; font-weight: 800; font-size: clamp(4.5rem, 3rem + 8vw, 8rem); line-height: .9; letter-spacing: -.03em; color: var(--ink); }
.ar-404__n::after { content: ""; display: block; width: 64px; height: 3px; margin-top: 12px; background: var(--senal); }
.ar-404__busca label { display: block; }
.ar-404__busca .busca--grande { max-width: 560px; }

/* ---------- Sugerencias bajo un campo (404 y widget) ---------- */
.ar .busca input:focus-visible { box-shadow: none; }
.busca__res .busca__it { width: 100%; border: 0; background: none; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.busca__res .busca__it small { display: block; }
.ar-sug-ico { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); justify-self: center; }
.ar-sug-ico--est { background: var(--muted); }
.ar-sug-vacio { padding: 10px; }
.busca .busca__res { max-height: 300px; overflow: auto; }

/* ---------- Boletín ---------- */
.ar-boletin__t { gap: var(--e-3); padding: var(--e-5); border-top: 3px solid var(--ok); }
.ar-boletin__t--mal { border-top-color: var(--av-rojo); }
.ar-boletin__ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sunk); color: var(--ok); }
.ar-boletin__t--mal .ar-boletin__ico { color: var(--av-rojo-t); }
.ar-boletin__ico .ico { width: 24px; height: 24px; }
.ar-boletin__email { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* ---------- Constructor de widgets ---------- */
.ar-widget .lc__pest { margin-top: var(--e-3); }
.ar-wg { display: grid; gap: var(--e-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.ar-wg[hidden] { display: none; }
@media (min-width: 1040px) { .ar-wg { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--e-6); } .ar-wg__vista { position: sticky; top: 76px; } }
.ar-wg__opc { gap: var(--e-4); }
.ar-campo { display: grid; gap: 6px; min-width: 0; }
.ar-campo > label, .ar-campo__l { font-weight: 600; font-size: var(--t-2); }
.ar-campo .seg { justify-self: start; }
.ar-campo .seg__op { padding: 0 14px; }
.ar-campo .busca { background: var(--surface); border-color: var(--line-2); }
.ar-campo .busca:focus-within { border-color: var(--ink); }
.ar-campo .campo { width: 100%; font: inherit; }
.ar-wg__marco { padding: var(--e-3); border-radius: var(--r-3); background: var(--sunk); }
.ar-wg__marco iframe { background: #fff; border-radius: 12px; }
.ar-wg__marco--oscuro { background: #1e1e2e; }
#est-preview-box.ar-wg__marco--oscuro { background: #020617; }
#est-preview-box iframe { background: transparent; }
.ar-codigo { width: 100%; height: auto; min-height: 9rem; padding: 10px 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink-2); background: var(--raised); resize: vertical; white-space: pre-wrap; overflow-wrap: anywhere; }
.ar-ventaja .ico { color: var(--ink-2); width: 24px; height: 24px; }
