/* Topic pages (15 problem pages + servicios). Loaded after tokens.css, main.css and pages.css; every value is a token.
   Markup mirrors production (lhero, psec, cares, dudas, pcta, topiclinks); the motion layer lives in assets/js/topic.js. */

body.topic main { display: block; }

/* ---------- hero: chalk grid + brass tape measure ---------- */
.lhero--topic { position: relative; overflow: hidden; padding: 9.5rem 0 calc(var(--sp-6) + 28px); border-bottom: 0; }
.lhero__grid {
  --gy: 0px; /* parallax: the chalk grid slides inside the hero, the hero box never moves */
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background:
    linear-gradient(var(--c-line) 1px, transparent 1px) 0 var(--gy) / 100% 48px,
    linear-gradient(90deg, var(--c-line) 1px, transparent 1px) 0 0 / 48px 100%;
  -webkit-mask: radial-gradient(ellipse at 20% 35%, #000 25%, transparent 78%);
          mask: radial-gradient(ellipse at 20% 35%, #000 25%, transparent 78%);
}
.lhero--topic .lhero__inner { position: relative; gap: var(--sp-3); }
.lhero--topic .lhero__title { font-size: clamp(2.2rem, 4.6vw, 4.4rem); max-width: 20ch; }
.lhero--topic .lhero__title em { font-style: italic; font-weight: 400; color: var(--c-thread); }
.lhero--topic .lhero__lede { max-width: 54ch; }
.lhero--topic .lhero__cta { margin-top: var(--sp-1); }
.lhero__tape { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; }

/* ---------- lead: editorial intro ---------- */
.psec--lead { padding-block: var(--sp-5) var(--sp-6); }
.psec--lead .psec__grid { align-items: start; }
.topic__lead { grid-column: 1 / span 9; max-width: 62ch; font-size: var(--fs-1); line-height: 1.5; }
.topic__lead p:first-child { color: var(--c-text); font-size: var(--fs-2); line-height: 1.3; font-family: var(--font-display); font-weight: 400; text-wrap: pretty; }
.topic__lead p + p { margin-top: var(--sp-3); }

/* ---------- section bodies ---------- */
body.topic .psec__body { max-width: 56ch; }
.psec__more { margin-top: var(--sp-3); }
.psec__more .link { display: inline-block; font-size: var(--fs-0); }
.psec--tint .cares { margin-top: 0; }
.psec--tint .carecard p { font-size: var(--fs-0); }

/* ---------- FAQ (native <details>, production class names) ---------- */
.dudas { padding: var(--sp-6) 0 calc(var(--sp-6) + var(--pink)); }
.dudas__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4); }
.dudas__grid .h2 { grid-column: 1 / span 5; align-self: start; position: sticky; top: var(--sp-6); font-size: clamp(2rem, 3.8vw, 3.4rem); }
.dudas__list { grid-column: 6 / span 7; display: grid; }
.dudas details { border-bottom: var(--stitch) dashed var(--c-line); }
.dudas summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 44px; padding: var(--sp-3) 0;
  cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-1); line-height: 1.2;
}
.dudas summary::-webkit-details-marker { display: none; }
.dudas summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%;
  background: var(--c-thread); color: var(--c-bg); font-family: var(--font-body); font-size: 0.8em;
  transition: rotate var(--dur-base) var(--ease-signature);
}
.dudas details[open] summary::after { rotate: 45deg; }
.dudas summary:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.dudas details p { padding-bottom: var(--sp-3); color: var(--c-text-soft); max-width: 60ch; }

/* ---------- closing band ---------- */
.pcta .h2 { max-width: 20ch; }
.pcta__inner { gap: var(--sp-4); }

/* ---------- link cards: "Otros problemas que resolvemos" ---------- */
.topiclinks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.topiclinks li { display: flex; }
.topiclinks__a {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  min-height: 5.5rem; padding: var(--sp-3); text-decoration: none; background: var(--c-bg); color: var(--c-text);
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-1); line-height: 1.15;
  border: var(--stitch) dashed var(--c-muted); border-radius: 6px 6px var(--radius-m) var(--radius-m);
  box-shadow: 0 18px 28px -24px var(--c-shadow);
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.topiclinks__a span:last-child { flex: none; color: var(--c-thread); font-family: var(--font-body); font-size: var(--fs-1); transition: transform var(--dur-base) var(--ease-out); }
.topiclinks__a:hover { border-color: var(--c-thread); background: var(--c-dominant); color: var(--c-on-dark); }
.topiclinks__a:hover span:last-child { color: var(--c-accent); transform: translateX(6px); }
.topiclinks__a:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }

/* ---------- servicios: whole card is the link ---------- */
.svc .ncard { transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out); }
.svc .ncard__h a { text-decoration: none; }
.svc .ncard__h a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.svc .ncard:hover { background: var(--c-on-dark); }
.svc .ncard:focus-within { outline: 3px solid var(--c-accent); outline-offset: 3px; }
.svc .ncard__h { font-size: var(--fs-2); }
.nsec .psec__note { margin-top: var(--sp-5); font-size: var(--fs-1); color: var(--c-text-soft); }
.nsec .psec__note + p { margin-top: var(--sp-3); }

@media (max-width: 960px) {
  .lhero--topic { padding-top: 7.5rem; }
  .topic__lead { grid-column: 1 / -1; }
  .dudas__grid { grid-template-columns: 1fr; }
  .dudas__grid .h2, .dudas__list { grid-column: 1 / -1; position: static; }
  .topiclinks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .lhero--topic { padding-bottom: calc(var(--sp-5) + 28px); }
  .topiclinks { grid-template-columns: 1fr; }
  .dudas { padding-top: var(--sp-5); }
  .topiclinks__a { min-height: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dudas summary::after, .topiclinks__a, .topiclinks__a span:last-child, .svc .ncard { transition: none; }
  .topiclinks__a:hover span:last-child { transform: none; }
}
