/* ==========================================================================
   Atend — sistema de diseño
   Enfermería especializada a domicilio · CDMX y área metropolitana
   Hoja única compartida por todas las páginas.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  /* Color. El teal es el único acento: todo lo demás es tinta, niebla y papel. */
  --ink:        #0C2733;   /* navy-teal profundo: texto principal y superficies oscuras */
  --ink-soft:   #40606D;   /* texto secundario */
  --teal:       #1B8A8E;   /* acento de marca */
  --teal-deep:  #0F5457;   /* acento en hover y fondos oscuros */
  --mist:       #EAF2F3;   /* superficie clara */
  --paper:      #FBFCFC;   /* fondo de página */
  --line:       #D6E3E5;   /* filetes */
  --white:      #FFFFFF;

  /* Tipografía */
  --display: 'Spectral', Georgia, 'Times New Roman', serif;
  --body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Escala tipográfica */
  --t-hero:  clamp(2.5rem, 5.4vw, 4.15rem);
  --t-h2:    clamp(1.9rem, 3.6vw, 2.9rem);
  --t-h3:    clamp(1.25rem, 2vw, 1.55rem);
  --t-lead:  clamp(1.06rem, 1.5vw, 1.28rem);
  --t-body:  1rem;
  --t-small: 0.875rem;
  --t-label: 0.75rem;

  /* Ritmo vertical y medidas */
  --gap:      1.5rem;
  --section:  clamp(4.5rem, 9vw, 8rem);
  --measure:  62ch;
  --shell:    1180px;
  --radius:   14px;

  --shadow-card: 0 1px 2px rgba(12, 39, 51, .05), 0 12px 32px -12px rgba(12, 39, 51, .14);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* --- Base --------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 { font-size: var(--t-hero); letter-spacing: -0.03em; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.25; }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

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

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

/* --- Utilidades de estructura ------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section { padding-block: var(--section); }
.section--mist { background: var(--mist); }
.section--ink  { background: var(--ink); color: var(--mist); }
.section--ink h2, .section--ink h3 { color: var(--white); }
.section--ink a { color: var(--white); }

/* Eyebrow: nombra la sección, no la decora. */
.eyebrow {
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 1rem;
}
.section--ink .eyebrow { color: var(--teal-mid, #7FC4C7); }

.lead {
  font-size: var(--t-lead);
  line-height: 1.6;
  color: var(--ink-soft);
}
.section--ink .lead { color: #B9D2D6; }

.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }

/* --- Botones ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .95rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--teal); color: var(--white); }
.btn--primary:hover { background: var(--teal-deep); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal-deep); }

.section--ink .btn--ghost { color: var(--white); border-color: rgba(255,255,255,.28); }
.section--ink .btn--ghost:hover { border-color: var(--white); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* --- Encabezado --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 252, 252, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: 76px;
}

.site-header__logo img { height: 38px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .93rem;
  font-weight: 500;
  transition: color .2s var(--ease);
}
.site-nav a:hover { color: var(--teal); }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .site-header .btn--primary { margin-left: auto; padding: .8rem 1.15rem; font-size: .875rem; }
}

/* --- Hero --------------------------------------------------------------- */

.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) var(--section); }

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 { margin-bottom: .45em; }
.hero__lead { font-size: var(--t-lead); color: var(--ink-soft); margin-bottom: 2rem; }

/* Vocabulario clínico: las palabras son la imagen. */
.vocab {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.vocab__label {
  font-size: var(--t-label);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 .85rem;
}
.vocab__list {
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}
.vocab__list span { color: var(--teal); }

.hero__media { position: relative; }
.hero__media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .hero__media img { aspect-ratio: 16 / 10; }
}

/* --- Cuadro de competencias (elemento firma) ---------------------------- */

.scope { border-top: 1px solid var(--line); }

.scope__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.scope__table caption {
  caption-side: top;
  text-align: left;
  color: var(--ink-soft);
  font-size: var(--t-small);
  padding-bottom: 1rem;
}
.scope__table th, .scope__table td {
  padding: .95rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.scope__table thead th {
  background: var(--paper);
  font-family: var(--body);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
}
.scope__table tbody tr:hover { background: var(--mist); }
.scope__table td.is-level { width: 8.5rem; text-align: center; }

.mark {
  display: inline-block;
  width: 1.35rem; height: 1.35rem;
  line-height: 1.35rem;
  text-align: center;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
}
.mark--yes { background: var(--teal); color: var(--white); }
.mark--no  { background: transparent; color: var(--line); border: 1px solid var(--line); }

.scope__note {
  margin-top: 1.5rem;
  padding: 1.15rem 1.35rem;
  background: var(--mist);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--t-small);
  color: var(--ink-soft);
}
.scope__note p { max-width: none; }

.scope__scroll { overflow-x: auto; }

@media (max-width: 640px) {
  .scope__table { font-size: .875rem; min-width: 34rem; }

}

/* --- Tarjetas ----------------------------------------------------------- */

.grid {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); font-size: .95rem; }

.card--link { text-decoration: none; color: inherit; display: block; transition: border-color .25s var(--ease), transform .25s var(--ease); }
.card--link:hover { border-color: var(--teal); transform: translateY(-2px); }

.section--ink .card { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.14); }
.section--ink .card p { color: #B9D2D6; }

/* --- Turnos ------------------------------------------------------------- */

.shift {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.shift__hours {
  font-family: var(--display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1;
  color: var(--teal);
}
.shift__hours small { font-size: .35em; color: var(--ink-soft); margin-left: .35rem; }

/* --- Proceso (secuencia real: el orden importa) ------------------------- */

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 2rem 3.75rem;
  border-left: 1px solid var(--line);
  margin-left: 1.15rem;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -1.15rem; top: -.15rem;
  width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  background: var(--paper);
  border: 1px solid var(--teal);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--teal-deep);
}
.section--mist .steps li::before { background: var(--mist); }
.steps h3 { margin-bottom: .3rem; }
.steps p { color: var(--ink-soft); font-size: .95rem; }

/* --- Preguntas ---------------------------------------------------------- */

.faq { border-top: 1px solid var(--line); max-width: 52rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--body);
  font-size: 1.4rem;
  color: var(--teal);
  transition: transform .25s var(--ease);
  flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { padding-bottom: 1.35rem; color: var(--ink-soft); }

/* --- Cierre y pie ------------------------------------------------------- */

.closer { text-align: center; }
.closer h2 { margin-inline: auto; max-width: 20ch; }
.closer p { margin-inline: auto; }
.closer .btn-row { justify-content: center; margin-top: 2rem; }

.site-footer {
  background: var(--ink);
  color: #9FBEC4;
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  font-size: var(--t-small);
}
.site-footer h4 {
  font-family: var(--body);
  font-size: var(--t-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1rem;
}
.site-footer a { color: #9FBEC4; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.site-footer__logo img { height: 34px; filter: brightness(0) invert(1); opacity: .92; }
.site-footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: .8rem;
}

/* --- Botón flotante de WhatsApp ----------------------------------------- */

.fab-whatsapp {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  z-index: 60;
  width: 3.5rem; height: 3.5rem;
  display: grid; place-items: center;
  background: #25D366;
  color: var(--white);
  border-radius: 50%;
  box-shadow: 0 6px 20px -4px rgba(12, 39, 51, .35);
  transition: transform .25s var(--ease);
}
.fab-whatsapp:hover { transform: scale(1.06); }
.fab-whatsapp svg { width: 1.75rem; height: 1.75rem; }

/* --- Accesibilidad ------------------------------------------------------ */

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .5rem; top: -3rem;
  background: var(--ink); color: var(--white);
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) var(--radius);
  z-index: 100; transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

/* --- Artículos ---------------------------------------------------------- */

.article { padding-block: clamp(3rem, 6vw, 4.5rem) var(--section); }
.article__shell { max-width: 46rem; margin-inline: auto; }

.article__meta {
  display: flex; flex-wrap: wrap; gap: 1rem;
  font-size: var(--t-small); color: var(--ink-soft);
  padding-bottom: 1.5rem; margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.article__body > h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-top: 2.75rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line);
}
.article__body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.article__body > h3 { margin-top: 2rem; font-size: 1.2rem; }
.article__body p, .article__body li { color: var(--ink-soft); }
.article__body > p { max-width: none; }
.article__body ul, .article__body ol { padding-left: 1.25rem; margin: 0 0 1.4em; display: grid; gap: .55rem; }
.article__body strong { color: var(--ink); font-weight: 600; }

.callout {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--mist);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p { color: var(--ink-soft); }
.callout strong { color: var(--ink); }

.compare { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 1.75rem 0; }
.compare th, .compare td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th {
  font-family: var(--body); font-size: var(--t-label); font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
}
.compare td { color: var(--ink-soft); }
.compare__wrap { overflow-x: auto; }
@media (max-width: 640px) { .compare { min-width: 34rem; } }

.post-card { display: block; text-decoration: none; color: inherit; }
.post-card h3 { margin-bottom: .4rem; }
.post-card p { color: var(--ink-soft); font-size: .95rem; }
.post-card__tag {
  font-size: var(--t-label); letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); margin: 0 0 .75rem;
}
.compare tbody tr:last-child td { border-bottom: 0; }
.compare__wrap { margin-bottom: 0; }

/* --- Índice de contenidos (aviso legal) --------------------------------- */
.toc {
  margin: 2rem 0 2.5rem;
  padding: 1.4rem 1.6rem;
  background: var(--mist);
  border-radius: var(--radius);
}
.toc-title {
  font-size: var(--t-label); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .9rem;
}
.toc ol, .toc ul { margin: 0; padding-left: 1.15rem; display: grid; gap: .4rem; }
.toc a { color: var(--teal-deep); }
.updated { font-size: var(--t-small); color: var(--ink-soft); }
