/* Layout: biblioteca de lectura. Un índice breve y un tema por vista (enlace directo por #tema);
   columna de texto angosta, con figuras propias intercaladas. Identidad del sitio: vino, marfil y nogal. */
:root {
  --paper: #F7F2EA; --surface: #FFFDF9; --ink: #241C1A; --muted: #6B5E5A; --line: #E3D8CC;
  --guindo: #5B2F36; --guindo-2: #7D4650; --wood: #A66F3F; --wood-soft: #F1E6D8; --wood-ink: #6E4521;
  --hero: #FBF8F3; --hero-ink: #5B2F36; --hero-muted: #6B5E5A; --hero-line: #E3D8CC; --on-accent: #FFFFFF;
  --alert: #8A3A42; --alert-soft: #F7E6E6;
  --c-tdah: #B07A4A; --c-tea: #7D4650; --dot-off: #E3D8CC;
  --f-display: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --f-body: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 66ch; --radius: 12px;
}
:root { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; color: var(--guindo); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 4vw, 1.95rem); }
h3 { font-family: var(--f-body); font-weight: 600; font-size: 1.08rem; color: var(--ink); line-height: 1.3; }
p { margin: 0; }
a { color: var(--guindo-2); }
:focus-visible { outline: 3px solid var(--wood); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 860px; margin: 0 auto; padding-inline: 20px; }
.prose { display: grid; gap: 14px; max-width: var(--measure); }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.ref { font-size: .7em; color: var(--wood-ink); font-weight: 600; margin-left: 1px; }
.small { font-size: .9rem; color: var(--muted); }

/* portada */
.hero { background: var(--hero); color: var(--ink); padding-block: 44px 40px; border-bottom: 1px solid var(--hero-line); }
.hero h1 { color: var(--hero-ink); max-width: 16em; }
.hero p { color: var(--hero-muted); max-width: 40em; margin-top: 16px; font-size: 1.1rem; }
.hero .eyebrow { margin: 0 0 12px; font-size: .95rem; }
.slats { height: 14px; margin-top: 30px; background: repeating-linear-gradient(90deg, var(--wood) 0 7px, transparent 7px 20px); opacity: .6; border-radius: 2px; max-width: 320px; }

/* índice */
.index { padding-block: 40px 56px; display: grid; gap: 34px; }
.topics { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--guindo); }
.topics li { border-bottom: 1px solid var(--line); }
.topics a { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline; padding: 18px 2px; text-decoration: none; color: inherit; }
.topics a:hover .tname { color: var(--guindo-2); text-decoration: underline; text-underline-offset: 4px; }
.tname { font-family: var(--f-display); font-size: 1.4rem; color: var(--guindo); }
.tdesc { grid-column: 1; color: var(--muted); font-size: .98rem; }
.tgo { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--wood-ink); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.soon { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.soon li { border: 1px dashed var(--line); border-radius: 999px; padding: .3em .9em; font-size: .92rem; color: var(--muted); }
.howto { background: var(--wood-soft); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 8px; max-width: var(--measure); }

/* tema */
.topic { padding-block: 0 64px; }
.thead { background: var(--hero); color: var(--ink); padding-block: 36px 34px; border-bottom: 1px solid var(--hero-line); }
.thead h1 { color: var(--hero-ink); }
.thead .eyebrow a { color: inherit; text-underline-offset: 3px; }
.thead .eyebrow { color: var(--hero-muted); font-size: .92rem; margin-bottom: 10px; }
.thead .lede { color: var(--hero-muted); font-size: 1.12rem; max-width: 38em; margin-top: 14px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.toc a { text-decoration: none; font: inherit; font-size: .88rem; font-weight: 500; color: var(--hero-ink); background: var(--wood-soft); border: 1px solid var(--hero-line); border-radius: 999px; padding: .35em .9em; cursor: pointer; }
.toc a:hover { background: var(--wood); border-color: var(--wood); color: var(--on-accent); }
.sec { padding-top: 44px; display: grid; gap: 18px; }
.sec > h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* en breve */
.brief { margin-top: 30px; border-left: 4px solid var(--wood); background: var(--surface); padding: 18px 20px; border-radius: 0 var(--radius) var(--radius) 0; display: grid; gap: 10px; max-width: var(--measure); }
.brief h2 { font-family: var(--f-body); font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; color: var(--wood-ink); font-weight: 600; }
.brief ul { margin: 0; padding-left: 1.1em; display: grid; gap: 7px; }

/* figuras */
figure { margin: 6px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
figcaption { font-size: .88rem; color: var(--muted); max-width: 62ch; }
.figtitle { font-weight: 600; font-size: 1rem; }

/* de cada 100 */
.hundreds { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hundred { display: grid; gap: 10px; }
.dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; max-width: 300px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--dot-off); }
.dots i.on { background: var(--guindo-2); }
.clinic { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; max-width: var(--measure); }
.clinic h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.25rem; color: var(--guindo); }
.clinic ol { margin: 0; padding-left: 1.3em; display: grid; gap: 9px; }
.family .places { border-top-color: var(--line); max-width: none; }
.family .places li { border-bottom-color: var(--line); }
.family h3.sub { margin-top: 6px; }
.bignum { font-family: var(--f-display); font-size: 2rem; color: var(--guindo); line-height: 1; }

/* dos columnas comparativas */
.duo { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.duo > div { min-width: 0; display: grid; gap: 10px; align-content: start; }
.duo h3 { padding-bottom: 6px; border-bottom: 2px solid var(--wood); }
.duo ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: .98rem; }

/* escalera de tratamiento */
.ladder { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.ladder > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 14px; padding: 16px 18px; }
.ladder > div + div { border-top: 1px solid var(--line); }
.ladder b.age { font-family: var(--f-display); font-size: 1.15rem; color: var(--guindo); font-weight: 500; }
.ladder p { font-size: .98rem; }
@media (max-width: 560px) { .ladder > div { grid-template-columns: 1fr; gap: 4px; } }

/* línea de tiempo (sí es una secuencia) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.4rem 1fr; gap: 0 14px; padding-bottom: 20px; position: relative; }
.steps li::before { content: counter(s); grid-row: 1 / span 2; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--wood-soft); border: 1.5px solid var(--guindo-2); color: var(--guindo); display: grid; place-items: center; font-family: var(--f-display); font-size: 1.05rem; z-index: 1; }
.steps li::after { content: ""; position: absolute; left: 1.08rem; top: 2.2rem; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps .when { font-weight: 600; }
.steps .what { color: var(--muted); font-size: .98rem; grid-column: 2; }

/* mitos */
.myths { display: grid; gap: 0; border-top: 1px solid var(--line); max-width: var(--measure); }
.myths details { border-bottom: 1px solid var(--line); }
.myths summary { cursor: pointer; padding: 15px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.myths summary::-webkit-details-marker { display: none; }
.myths summary::after { content: "+"; font-family: var(--f-display); font-size: 1.4rem; line-height: 1; color: var(--wood-ink); }
.myths details[open] summary::after { content: "–"; }
.myths details p { padding-bottom: 16px; color: var(--muted); }

/* familia y avisos */
.family { background: var(--wood-soft); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; }
.family h2 { border: 0; padding: 0; }
.urgent { background: var(--alert-soft); border-left: 4px solid var(--alert); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 20px; display: grid; gap: 10px; max-width: var(--measure); }
.urgent h2 { font-family: var(--f-body); font-weight: 600; font-size: 1.1rem; color: var(--alert); border: 0; padding: 0; }
.urgent ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.tel { font-weight: 600; white-space: nowrap; user-select: all; }

/* perfiles */
.profiles { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.profile { display: grid; gap: 8px; min-width: 0; }
.prow { display: grid; grid-template-columns: 1fr; gap: 3px; font-size: .88rem; }
.ptrack { height: 9px; border-radius: 5px; background: var(--dot-off); position: relative; overflow: hidden; }
.ptrack i { position: absolute; inset: 0 auto 0 0; background: var(--c-tea); border-radius: 5px; }

/* venn */
.venn svg { width: 100%; height: auto; max-width: 560px; justify-self: center; display: block; }
.venn .ca { fill: var(--c-tdah); fill-opacity: .28; stroke: var(--c-tdah); stroke-width: 2; }
.venn .cb { fill: var(--c-tea); fill-opacity: .24; stroke: var(--c-tea); stroke-width: 2; }
.venn text { fill: var(--ink); font-family: var(--f-body); }
.venn .vt { font-family: var(--f-display); font-size: 22px; }
.venn .vn { font-size: 14px; }
.venn .vs { font-size: 13px; fill: var(--muted); }
.tri { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tri > div { min-width: 0; display: grid; gap: 8px; align-content: start; }
.tri h3 { padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.tri .k-a h3 { border-color: var(--c-tdah); } .tri .k-b h3 { border-color: var(--c-tea); } .tri .k-s h3 { border-color: var(--wood-ink); }
.tri ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: .97rem; }

/* dónde acudir */
.places { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: var(--measure); }
.places li { padding: 13px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.places b { font-weight: 600; }
.places span { color: var(--muted); font-size: .96rem; }

/* fuentes */
.sources ol { margin: 0; padding-left: 1.5em; display: grid; gap: 7px; font-size: .88rem; color: var(--muted); max-width: 74ch; overflow-wrap: anywhere; }
.sources a { color: var(--muted); }

/* cierre */
.closing { margin-top: 48px; background: var(--wood-soft); color: var(--ink); border-radius: var(--radius); padding: 26px 24px; display: grid; gap: 12px; }
.closing h2 { color: var(--hero-ink); border: 0; padding: 0; }
.closing p { color: var(--hero-muted); max-width: 40em; }
.btn { display: inline-flex; align-items: center; justify-self: start; gap: .5em; padding: .75em 1.3em; border-radius: 999px; background: var(--guindo-2); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.btn:hover { filter: brightness(.92); }
footer { padding-block: 26px 40px; font-size: .86rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 40px; }
footer p + p { margin-top: 6px; }
/* círculo de la ansiedad */
.cycle { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); counter-reset: c; }
.cycle li { counter-increment: c; min-width: 0; background: var(--wood-soft); border-radius: 10px; padding: 14px; display: grid; gap: 4px; align-content: start; }
.cycle li::before { content: counter(c); font-family: var(--f-display); font-size: 1.5rem; line-height: 1; color: var(--guindo-2); }
.cycle b { font-weight: 600; }
.cycle span { font-size: .93rem; color: var(--muted); }

/* barras horizontales */
.hbars { display: grid; gap: 12px; }
.hb { display: grid; grid-template-columns: minmax(8rem, 15rem) 1fr 3.4rem; gap: 12px; align-items: center; font-size: .95rem; }
.hb .t { height: 14px; border-radius: 7px; background: var(--dot-off); overflow: hidden; }
.hb .t i { display: block; height: 100%; border-radius: 7px; background: var(--guindo-2); }
.hb .t i.alt { background: var(--wood); }
.hb b { font-family: var(--f-display); font-weight: 500; font-size: 1.1rem; color: var(--guindo); text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .hb { grid-template-columns: 1fr auto; gap: 4px 10px; } .hb span { grid-column: 1; } .hb b { grid-column: 2; grid-row: 1; } .hb .t { grid-column: 1 / -1; } }

/* curva del ánimo y del tratamiento */
.mood svg { width: 100%; height: auto; display: block; max-width: 640px; justify-self: center; }
.mood .band { fill: var(--wood-soft); }
.mood .axis { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 5; fill: none; }
.mood .curve { fill: none; stroke: var(--guindo-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mood .curve.dash { stroke: var(--wood); stroke-width: 2.5; stroke-dasharray: 6 6; }
.mood text { font-family: var(--f-body); }
.mood .lbl { fill: var(--ink); font-size: 19px; font-weight: 600; }
.mood .sm { fill: var(--muted); font-size: 16px; }

/* bloques */
.grid4 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid4 > div { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--wood); border-radius: 0 0 10px 10px; padding: 16px; display: grid; gap: 6px; align-content: start; }
.grid4 p { font-size: .96rem; color: var(--muted); }

/* tablas */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tbl { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--wood-ink); font-weight: 600; background: var(--wood-soft); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { min-width: 9.5rem; }
@media (max-width: 640px) {
  .tblwrap { overflow: visible; border: 0; background: transparent; border-radius: 0; }
  .tbl { min-width: 0; display: block; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl tbody { display: grid; gap: 12px; }
  .tbl tr { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--wood); border-radius: 0 0 10px 10px; padding: 14px 16px; }
  .tbl td { display: block; padding: 0; border: 0; }
  .tbl td:first-child { font-size: 1.02rem; }
  .tbl td:not(:first-child)::before { content: attr(data-label); display: block; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--wood-ink); font-weight: 600; }
}
[data-view][hidden] { display: none !important; }

/* encabezado y pie del sitio */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(46,13,20,.96); border-bottom: 1px solid rgba(255,255,255,.12); }
.site-head .wrap { max-width: 1120px; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 66px; }
.brand { font-family: var(--f-display); font-size: 1.12rem; color: #F7EFE6; text-decoration: none; font-weight: 600; line-height: 1.2; }
.brand small { display: block; font-family: var(--f-body); font-weight: 400; font-size: .8rem; color: #D9C6BD; letter-spacing: .02em; }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a.l { color: #F7EFE6; text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a.l:hover { color: #D29A67; }
.site-nav a.l.here { border-bottom: 2px solid #B07A4A; padding-bottom: 2px; }
.site-nav .wa { display: inline-flex; align-items: center; gap: .5em; padding: .55em 1.05em; border-radius: 999px; background: #B07A4A; color: #fff; font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.site-nav .wa:hover { background: #8E5B33; }
.site-nav .wa svg { width: 1.2em; height: 1.2em; flex: none; }
@media (max-width: 700px) { .site-nav a.l.opt { display: none; } }
@media (max-width: 420px) { .site-nav { gap: 12px; } .brand small { display: none; } }
.related { margin-top: 48px; display: grid; gap: 12px; }
.related h2 { font-size: 1.35rem; }
.related .topics .tname { font-size: 1.15rem; }
.related .topics a { padding: 14px 2px; }
.crumbs { font-size: .9rem; color: var(--muted); padding-top: 18px; }
.crumbs a { color: var(--muted); }
footer .row { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; }
footer a { color: var(--muted); }
