/* Help centre /ayuda (task #579). Loaded after site.css and reuses its tokens, header, footer and
   buttons. Pages are generated by tools/ayuda/build.php: edit the Markdown, not the HTML. */

/* Anchor jumps clear the sticky header + search bar. ONE offset only: a scroll-margin on the
   headings would ADD to this padding (site.css sets it on html too). */
html { scroll-padding-top: calc(var(--header-h) + 72px); }

.brand-tag { margin-left: 10px; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(0, 255, 236, .45);
  color: var(--cyan); font: 600 .78rem/1.4 var(--body); letter-spacing: .04em; }

/* ---------- search ---------- */
.subbar { background: var(--violet-900); padding: 10px 0; position: sticky; top: var(--header-h); z-index: 40; }
.hsearch, .bigsearch { position: relative; }
.hsearch input, .bigsearch input { width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 2px solid transparent; border-radius: 999px; outline: none; }
.hsearch input { max-width: 520px; padding: .5em 1.1em; font-size: .95rem; }
.bigsearch { max-width: 640px; margin-top: 28px; }
.bigsearch input { padding: .95em 1.4em; font-size: 1.05rem; box-shadow: var(--shadow-lg); }
.hsearch input:focus, .bigsearch input:focus { border-color: var(--cyan); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-width: 640px; max-height: min(70vh, 520px);
  overflow-y: auto; background: var(--white); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 60; text-align: left; }
.results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a[aria-selected="true"] { background: var(--lilac); }
.results .rm { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); }
.results .rh { display: block; font-weight: 600; }
.results .rx { display: block; font-size: .86rem; color: var(--muted); }
.results mark { background: #e7fffd; color: inherit; border-radius: 3px; }
.results .none { padding: 12px; color: var(--muted); }

/* ---------- hub ---------- */
.hub-hero { background: var(--deep); color: var(--white); padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 96px); }
.hub-hero .eyebrow { color: var(--cyan); }
.hub-hero h1 { max-width: 14em; }
.hub { padding: clamp(40px, 6vw, 72px) 0; }
.mgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: calc(-1 * clamp(80px, 10vw, 120px)); }
.mcard { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: var(--radius); background: var(--white);
  border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.mcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mcard h2 { font-size: 1.6rem; margin: 0; }
.mcard p { color: var(--muted); font-size: .93rem; margin: 0 0 8px; flex: 1; }
.micon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; }
.micon svg { width: 26px; height: 26px; }
.mwho { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mgo { font-weight: 600; color: var(--violet); }
.tone-violet .micon { background: var(--violet); color: var(--white); }
.tone-cyan .micon { background: var(--cyan); color: var(--deep); }
.tone-deep .micon { background: var(--deep); color: var(--cyan); }
.hub-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 48px; }
.hub-two h2, .hub-latest h2, .more h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.quick ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.quick a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.quick a:hover { color: var(--violet-700); }
.support { background: var(--lilac); border-radius: var(--radius); padding: 24px; }
.support p { color: var(--muted); }
.hub-latest { margin-top: 56px; }
.hub-latest .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hub-latest .row a { font-weight: 600; text-decoration: none; }

/* ---------- manual / post header ---------- */
.doc-hero { background: var(--deep); color: var(--white); padding: 32px 0 36px; }
.doc-hero.tone-violet { background: linear-gradient(135deg, var(--violet-900), var(--violet)); }
.doc-hero.tone-cyan { background: linear-gradient(135deg, var(--deep), #063b45); }
.doc-hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); margin: 10px 0 6px; max-width: 18em; }
.doc-hero .meta { color: rgba(255, 255, 255, .7); font-size: .9rem; margin: 0; }
.doc-hero .lead { color: rgba(255, 255, 255, .85); }
.crumbs { font-size: .88rem; color: rgba(255, 255, 255, .7); }
.crumbs a { color: var(--cyan); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- manual layout ---------- */
.doc { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 48px; padding: 36px 0 64px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 72px); max-height: calc(100vh - var(--header-h) - 96px); overflow-y: auto; font-size: .9rem; }
.toc summary { font-weight: 700; cursor: pointer; padding: 6px 0; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; padding: 0; margin: 6px 0 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li.l3 a { padding-left: 28px; font-size: .86rem; }
.toc li a:hover { color: var(--ink); }
.toc li a[aria-current] { color: var(--violet); border-left-color: var(--violet); font-weight: 600; }
.toc-more { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.toc-more p { font-weight: 700; margin: 0 0 6px; }
.toc-more ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.toc-more a { text-decoration: none; }

/* ---------- prose (rendered Markdown) ---------- */
.prose { max-width: 760px; min-width: 0; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); color: var(--violet-900); margin: 56px 0 14px; padding-top: 4px; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; color: var(--violet-900); margin: 32px 0 8px; }
.prose h2, .prose h3 { position: relative; }
.prose .anchor { margin-left: 8px; color: var(--line); text-decoration: none; font-family: var(--body); font-weight: 400; opacity: 0; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; color: var(--violet); }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li { margin: 5px 0; }
.prose li > p { margin: 0; }
.prose code { font-size: .88em; background: var(--lilac); padding: .12em .4em; border-radius: 6px; overflow-wrap: anywhere; }
.prose a { overflow-wrap: anywhere; }
.prose strong { color: var(--violet-900); }
.note { margin: 18px 0; padding: 14px 18px; background: var(--lilac); border-left: 4px solid var(--violet); border-radius: 0 12px 12px 0; }
.note p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.prose th { background: var(--lilac); color: var(--violet-900); text-align: left; }
.prose th, .prose td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.shot { margin: 22px 0 26px; }
.shot img { width: 100%; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.shot figcaption { margin-top: 8px; font-size: .85rem; color: var(--muted); text-align: center; }
.help-cta { margin-top: 56px; padding: 22px 24px; border-radius: var(--radius); background: var(--deep); color: var(--white);
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.help-cta p { margin: 0; color: var(--white); }
.help-cta strong { color: var(--cyan); }

@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .toc { position: static; max-height: none; background: var(--lilac); border-radius: 14px; padding: 6px 16px; }
  .toc summary::after { content: " ▾"; color: var(--violet); }
  .toc details[open] summary::after { content: " ▴"; }
  .toc-more { display: none; }
  .prose .anchor { opacity: 1; }
}

/* ---------- recursos ---------- */
.narrow { max-width: 780px; }
.recursos { padding: 32px 0 72px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters button { font: 600 .9rem var(--body); padding: .5em 1.1em; border-radius: 999px; border: 1px solid var(--line);
  background: var(--white) !important; color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--violet) !important; border-color: var(--violet); color: var(--white); }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pcard a { display: flex; flex-direction: column; height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--white);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.pcard a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pcover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--violet-900), var(--violet)); display: grid; place-items: center; }
.pcover img { width: 100%; height: 100%; object-fit: cover; }
.pcover .ph svg { width: 48px; height: 48px; color: var(--cyan); }
.pbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pbody h3 { margin: 0; font-size: 1.08rem; }
.pbody p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.pbody time { font-size: .82rem; color: var(--muted); }
.ptype { align-self: flex-start; font: 700 .72rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--violet);
  background: var(--lilac); padding: 5px 9px; border-radius: 999px; }
.doc-hero .ptype { display: inline-block; margin-top: 12px; color: var(--deep); background: var(--cyan); }
.pcard[hidden] { display: none; }
.post { padding: 32px 0 48px; max-width: none; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 0 0 28px; border-radius: 14px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.download { margin: 0 0 28px; }
.more { background: var(--lilac); padding: 48px 0 64px; }
.empty { color: var(--muted); }

@media (max-width: 1100px) { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .hub-two { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .mgrid, .pgrid, .quick ul { grid-template-columns: 1fr; }
  .mgrid { margin-top: -48px; }
  .hub-hero { padding-bottom: 72px; }
  .brand-tag { display: none; }
  .prose table { font-size: .88rem; }
}
