/* ==========================================================================
   Clínica ART — infographic page
   Design tokens mirror the proyectoart.com theme: green #38A169, ink #1D1D1B,
   coral rule #FC8181, dark section #081A10, Merriweather 700/900 headings,
   Rubik body, 28px pill buttons.
   ========================================================================== */

:root {
  --green: #38a169;
  --green-deep: #226e4b;
  --green-soft: #edf5ef;
  --green-line: #cfe3d5;
  --coral: #fc8181;
  --ink: #1d1d1b;
  --muted: #585857;
  --line: #eeeeee;
  --dark: #081a10;
  --tint: #f8faf7;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --sans: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --wrap: 1180px;
  --header: 78px;
  --rail: 58px;
  --node: 44px;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

/* ---------- language ---------- */

html[data-lang="es"] [lang="en"],
html[data-lang="en"] [lang="es"] {
  display: none !important;
}

html:not(.js) .lang-switch { display: none; }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + var(--rail) + 24px);
}

body {
  margin: 0;
  font: 400 16px/1.7 var(--sans);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  color: var(--ink);
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
strong { font-weight: 500; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--green-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(var(--wrap), calc(100% - 56px));
  margin-inline: auto;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed;
  z-index: 200;
  left: 16px;
  top: -100px;
  padding: 12px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 28px;
  font-size: 14px;
}
.skip-link:focus { top: 12px; }

/* the short coral line the site uses above headings */
.rule {
  display: block;
  width: 32px;
  height: 2px;
  margin-bottom: 20px;
  background: var(--coral);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  transition: background-color .2s var(--ease);
}
.btn-lg { padding: 11px 48px; font-size: 18px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #2f8d5b; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--green-deep);
}
.link-arrow svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s var(--ease);
}
.link-arrow:hover svg { transform: translateY(3px); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  height: var(--header);
}

.brand { display: flex; flex-shrink: 0; }
.brand img { display: block; width: auto; height: 50px; }

.main-nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  font-size: 15px;
}
.main-nav a { transition: color .2s var(--ease); }
.main-nav a:hover { color: var(--green-deep); }

.header-actions { display: flex; align-items: center; gap: 16px; }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 28px;
}
.lang-switch button {
  min-width: 38px;
  min-height: 32px;
  border: 0;
  border-radius: 28px;
  background: none;
  font: 500 13px/1 var(--sans);
  color: var(--muted);
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--green-deep);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 64px;
}

.hero-watermark {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 420px;
  transform: translateX(-50%);
  opacity: .05;
  pointer-events: none;
}
.hero-watermark img { display: block; width: 100%; }

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 {
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.2;
}

.hero-lead {
  max-width: 58ch;
  margin-top: 20px;
  font-size: 18px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 28px;
  margin-top: 30px;
}

/* ---------- step rail ---------- */

.process-zone { position: relative; }

.step-rail-bar {
  position: sticky;
  top: var(--header);
  z-index: 90;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.step-rail {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
}
.step-rail::-webkit-scrollbar { display: none; }

.step-rail a {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 41px;
  padding: 0 14px;
  border-radius: 28px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.step-rail a:hover { color: var(--ink); }
.rail-num { font-weight: 700; color: var(--green-deep); }
.step-rail a.is-active {
  background: var(--green-soft);
  color: var(--green-deep);
}

/* ---------- timeline ---------- */

.process { padding: 56px 0 72px; }

.timeline {
  --progress: 1;
  position: relative;
  padding-left: calc(var(--node) + 32px);
}

/* a straight line through the centre of every step number */
.spine {
  position: absolute;
  top: 8px;
  bottom: 0;
  left: calc(var(--node) / 2 - 1px);
  width: 2px;
  background: var(--line);
}
.spine-fill {
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: scaleY(var(--progress));
  transform-origin: top;
}

.phase {
  margin: 56px 0 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-deep);
}
.phase:first-of-type { margin-top: 0; }

.step {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 344px;
  gap: 0 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}
.step:last-of-type { border-bottom: 0; padding-bottom: 0; }
/* a phase heading directly after a step already marks the boundary */
.step:has(+ .phase) { border-bottom: 0; }

.step-node {
  position: absolute;
  top: 36px;
  left: calc((var(--node) + 32px) * -1);
  display: grid;
  place-items: center;
  width: var(--node);
  height: var(--node);
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--green);
  font: 900 18px/1 var(--serif);
  color: #fff;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.js .step:not(.is-reached) .step-node {
  background: #fff;
  border-color: var(--green-line);
  color: var(--green-deep);
}

.step-icon {
  display: block;
  width: 104px;
  height: 92px;
  object-fit: contain;
  object-position: top left;
}

.step-text h3 {
  margin-bottom: 12px;
  font-size: 23px;
  line-height: 1.35;
}
.step-text p { color: var(--muted); }
.step-text p + p { margin-top: 12px; }

/* ---------- panels (the at-a-glance side of each step) ---------- */

.panel {
  align-self: start;
  padding: 22px 24px;
  border-radius: 12px;
  background: var(--tint);
  font-size: 15px;
  line-height: 1.5;
}

.panel-link, .card-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  color: var(--green-deep);
}
.panel-link { margin-top: 14px; font-size: 15px; }
.panel-link svg, .card-link svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s var(--ease);
}
.panel-link:hover svg, .card-link:hover svg { transform: translate(2px, -2px); }

.option { padding: 14px 0; border-top: 1px solid var(--green-line); }
.option:first-child { padding-top: 0; border-top: 0; }
.option-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.option-main .option-tag { color: var(--green-deep); }
.option-title {
  margin-top: 4px;
  font: 700 17px/1.4 var(--serif);
}
.option-meta { margin-top: 3px; color: var(--muted); }
.option-meta b { font-weight: 500; color: var(--ink); }

.facts li {
  position: relative;
  padding: 7px 0 7px 22px;
}
.facts li::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

/* the stages of step 3, joined by a small line */
.flow li {
  position: relative;
  padding: 0 0 18px 22px;
}
.flow li:last-child { padding-bottom: 0; }
.flow li::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  bottom: -3px;
  left: 5px;
  width: 2px;
  background: var(--green-line);
}
.flow-dots { display: flex; gap: 5px; margin-bottom: 7px; padding-top: 5px; }
.flow-dots i {
  width: 34px;
  height: 6px;
  border-radius: 3px;
  background: var(--green);
}
.flow-title { font-weight: 500; }
.flow-meta { color: var(--muted); }

.cost {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.cost-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.step-text .cost-sum {
  margin-top: 6px;
  font: 700 19px/1.5 var(--serif);
  color: var(--ink);
}
.cost-sum b { font-weight: 900; color: var(--green-deep); }
.cost .panel-link { margin-top: 8px; }

/* the ten sessions of step 5 */
.ten {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}
.ten i {
  height: 22px;
  border-radius: 4px;
  background: var(--green-line);
  transition: background-color .4s var(--ease);
}
.ten i.ten-last { background: var(--coral); }
.ten-caption { margin-top: 12px; color: var(--muted); }

/* calendar icon where the PDF set has no matching picture */
.step-icon-svg {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-tag { margin-bottom: 12px; color: var(--green-deep); }

/* session rhythm: eight weeks, one cell per week */
.rhythm + .rhythm { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--green-line); }
.weeks {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin-top: 10px;
}
.weeks i {
  height: 14px;
  border-radius: 3px;
  background: var(--green-line);
}
.weeks i.on { background: var(--green); }

/* family evaluation: one joint session, then two parallel paths */
.panel-wide { grid-column: 2 / -1; margin-top: 24px; padding: 24px; }
.track-start { padding-bottom: 16px; border-bottom: 1px solid var(--green-line); }
.tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding-top: 16px;
}
.track .option-tag { margin-bottom: 10px; color: var(--green-deep); }
.track-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--green-line);
  color: var(--muted);
}

/* community band between the process and the practical details */
.community { padding: 60px 0; background: var(--green-soft); }
.community-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}
.community h2 {
  margin-bottom: 12px;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.3;
}
.community p { max-width: 70ch; color: var(--muted); }
.community .btn { flex-shrink: 0; }

/* ---------- sections ---------- */

.section { padding: 76px 0; }

.section-head {
  max-width: 700px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.3;
}
.section-lead {
  margin-top: 12px;
  font-size: 17px;
  color: var(--muted);
}

/* ---------- practical cards ---------- */

.practical {
  background: var(--tint);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 26px;
  border-radius: 12px;
  background: #fff;
}

.card-wide {
  grid-column: 1 / -1;
  border: 1px solid var(--green-line);
}

.card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--green);
}
.card-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-body { min-width: 0; }

.card h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}
.card p { font-size: 15px; color: var(--muted); }

.card-link { margin-top: 10px; font-size: 15px; }
.card-links { display: flex; flex-wrap: wrap; gap: 0 20px; }

.howto {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin-top: 16px;
  counter-reset: howto;
  font-size: 15px;
  color: var(--muted);
}
.howto li {
  position: relative;
  padding-left: 38px;
  counter-increment: howto;
}
.howto li::before {
  content: counter(howto);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-soft);
  font: 900 13px/1 var(--serif);
  color: var(--green-deep);
}
.card-wide .card-link { margin-top: 16px; }

/* ---------- contact ---------- */

.channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.channel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.channel-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-deep);
}
.channel h3 {
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
.channel p:not(.channel-tag) { font-size: 15px; color: var(--muted); }
.channel-link {
  margin-top: 10px;
  font-weight: 500;
  color: var(--green-deep);
}
.channel-link + .channel-link { margin-top: 2px; }
.channel-link:hover { text-decoration: underline; }

.safety {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}
.safety a { font-weight: 500; color: var(--ink); text-decoration: underline; }

/* ---------- closing ---------- */

.closing {
  padding: 80px 0;
  background: var(--dark);
  color: #fff;
}
.closing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.closing-quote {
  max-width: 30ch;
  margin-bottom: 32px;
  font: 700 clamp(22px, 2.8vw, 30px)/1.45 var(--serif);
}

/* ---------- footer ---------- */

.site-footer {
  padding: 28px 0;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 32px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.footer-links a:hover { color: var(--green-deep); }
.footer-note { width: 100%; color: var(--muted); }

.mobile-cta { display: none; }

/* ---------- reveal: only when JS runs and motion is welcome ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .step > .step-icon,
  .js .step > .step-text,
  .js .step > .panel,
  .js .card,
  .js .channel {
    transition: opacity .55s var(--ease), transform .55s var(--ease);
  }
  .js .step:not(.is-visible) > .step-icon,
  .js .step:not(.is-visible) > .step-text,
  .js .step:not(.is-visible) > .panel,
  .js .card:not(.is-visible),
  .js .channel:not(.is-visible) {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* step 5: sessions fill up one after another as the step comes into view */
.is-visible .ten i { background: var(--green); }
.is-visible .ten i.ten-last { background: var(--coral); }
.ten i:nth-child(2) { transition-delay: .06s; }
.ten i:nth-child(3) { transition-delay: .12s; }
.ten i:nth-child(4) { transition-delay: .18s; }
.ten i:nth-child(5) { transition-delay: .24s; }
.ten i:nth-child(6) { transition-delay: .3s; }
.ten i:nth-child(7) { transition-delay: .36s; }
.ten i:nth-child(8) { transition-delay: .42s; }
.ten i:nth-child(9) { transition-delay: .48s; }
html:not(.js) .ten i:not(.ten-last) { background: var(--green); }

/* ---------- responsive ---------- */

@media (max-width: 1060px) {
  .step { grid-template-columns: 88px minmax(0, 1fr); }
  .step-icon { width: 88px; height: 78px; }
  .panel { grid-column: 2; margin-top: 20px; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-actions { margin-left: auto; }
  .step-rail a { flex: 0 0 auto; }
}

@media (max-width: 760px) {
  :root { --header: 66px; --rail: 56px; --node: 34px; }

  .wrap { width: calc(100% - 40px); }
  .header-cta { display: none; }
  .brand img { height: 42px; }

  .hero { padding: 48px 0; }
  .hero-watermark { width: 280px; }
  .hero-lead { font-size: 16.5px; }
  .hero-actions .btn { width: 100%; }

  /* numbers only, the current step also shows its name */
  .rail-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .step-rail a { min-width: 44px; padding: 0 12px; }
  .step-rail a.is-active .rail-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .process { padding: 36px 0 52px; }
  .timeline { padding-left: calc(var(--node) + 16px); }
  .phase { margin-top: 40px; }

  .step { display: block; padding: 26px 0; }
  .step-node {
    top: 26px;
    left: calc((var(--node) + 16px) * -1);
    font-size: 15px;
  }
  .step-icon { width: 72px; height: 64px; margin-bottom: 14px; }
  .step-text h3 { font-size: 20px; }
  .panel { margin-top: 18px; padding: 18px; }

  .community { padding: 48px 0; }
  .community-inner { flex-direction: column; align-items: stretch; gap: 24px; }

  .section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }
  .section-lead { font-size: 16px; }

  .cards, .channels, .howto, .tracks { grid-template-columns: 1fr; }
  .card { flex-direction: column; gap: 12px; padding: 22px; }
  .channel { padding: 22px; }
  .card-icon { width: 36px; height: 36px; }

  .closing { padding: 60px 0; }

  .site-footer { padding-bottom: 96px; }

  .mobile-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    display: block;
    padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
  }
  .mobile-cta .btn { width: 100%; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------- print ---------- */

@media print {
  .site-header, .step-rail-bar, .mobile-cta, .skip-link, .hero-actions, .closing .btn, .spine { display: none; }
  .timeline { padding-left: 0; }
  .step-node { position: static; margin-bottom: 8px; }
  .step, .card, .channel { break-inside: avoid; opacity: 1 !important; }
  .js .step > *, .js .card, .js .channel { opacity: 1 !important; transform: none !important; }
  .closing { padding: 24px 0; background: none; color: var(--ink); }
}
