/* Ajustes globales (cargado tras el CSS interno de cada página, gana en igualdad de especificidad). */
:root { --btn: #1a7c80; --btn-hover: #146367; --sec-y: 56px; }

/* ---------- Botones: acento más oscuro + texto blanco en negrita (contraste AA ~5:1) ---------- */
.btn { font-weight: 700; line-height: 1.25; text-align: center; justify-content: center; }
.btn-solid { background: var(--btn); color: #fff; box-shadow: 0 0 0 1px rgba(136,208,194,.35); }
.btn-solid:hover { background: var(--btn-hover); color: #fff; }

/* ---------- Cabecera flotante ---------- */
header.top { left: 12px; right: 12px; }
/* La barra ya no usa .wrap: estilos propios */
header.top { top: 8px; }
header.top .bar {
  color: var(--arena); pointer-events: auto; height: 48px; max-width: 1100px; margin: 0 auto; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 14px; background: rgba(3, 50, 67, .42);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background var(--dur-fade) var(--ease), box-shadow var(--dur-fade) var(--ease);
}
header.top.solid .bar { background: rgba(3, 50, 67, .92); box-shadow: 0 8px 32px rgba(3, 50, 67, .28); }
header.top .brand b { font-size: 14px; line-height: 20px; }
header.top nav { gap: 20px; font-size: 13px; }
header.top nav a.nav-cta {
  background: var(--btn); color: #fff; opacity: 1; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; line-height: 18px; font-size: 13px;
  box-shadow: 0 0 0 1px rgba(136,208,194,.35);
  transition: background var(--dur-fade) var(--ease), transform var(--dur-move) var(--ease);
}
header.top nav a.nav-cta:hover { background: var(--btn-hover); color: #fff; transform: translateY(-1px); }

/* ---------- Menú móvil (hamburguesa + panel derecho) ---------- */
.nav-toggle { display: none; }
.drawer-overlay, .drawer { visibility: hidden; position: fixed; }
@media (min-width: 901px) { .drawer, .drawer-overlay { display: none; } }
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; justify-content: center; align-items: center;
    width: 36px; height: 36px; margin-right: -6px; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: inherit; cursor: pointer;
  }
  .nav-toggle svg { display: block; fill: currentColor; }
  .nav-toggle:focus-visible, .drawer-close:focus-visible, .drawer a:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
  .drawer-overlay {
    position: fixed; inset: 0; z-index: 40; background: rgba(3,38,58,.6);
    opacity: 0; transition: opacity 250ms var(--ease), visibility 0s 250ms;
  }
  .drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(86vw, 340px);
    display: flex; flex-direction: column; gap: 8px; padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    background: var(--mar); color: var(--arena); box-shadow: -16px 0 48px rgba(0,0,0,.35);
    transform: translateX(100%); transition: transform 300ms var(--ease), visibility 0s 300ms; overflow-y: auto;
  }
  body.menu-open .drawer-overlay { visibility: visible; opacity: 1; transition: opacity 250ms var(--ease); }
  body.menu-open .drawer { visibility: visible; transform: none; transition: transform 300ms var(--ease); }
  body.menu-open { overflow: hidden; }
  .drawer-close {
    align-self: flex-end; width: 44px; height: 44px; border: 0; background: transparent; color: inherit;
    font-size: 32px; line-height: 1; cursor: pointer; border-radius: 12px;
  }
  .drawer a:not(.btn) {
    display: block; padding: 14px 4px; font-size: 18px; line-height: 24px; font-weight: 600;
    text-decoration: none; border-bottom: 1px solid rgba(136,208,194,.2);
  }
  .drawer a[aria-current="page"] { color: var(--aqua); }
  .drawer .btn { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-overlay { transition: none !important; }
}

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .wrap { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }

  /* Texto más contenido (mín. 16px en cuerpo, 12px en etiquetas) */
  body { font-size: 16px; line-height: 24px; }
  .hero h1 { font-size: clamp(30px, 8.4vw, 36px); }
  .block h2, .b-etapas h2, .b-casos h2 { font-size: clamp(26px, 7.4vw, 32px); }
  .b-cierre h2 { font-size: clamp(30px, 8.4vw, 38px); }
  .hero p, .block .lead, .b-etapas .lead, .b-cierre p { font-size: 16px; line-height: 24px; }
  .facts b { font-size: 26px; line-height: 32px; }
  .facts span { font-size: 14px; line-height: 20px; }
  .step b { font-size: 56px; }

  /* Botones a todo el ancho, sin altura excesiva */
  .btn { display: flex; width: 100%; min-height: 48px; padding: 12px 20px; font-size: 15px; letter-spacing: .03em; }
  .actions { flex-direction: column; align-items: stretch; }
  .card .btn, .b-cierre .btn { align-self: stretch; justify-self: stretch !important; }
  .b-cierre .wrap { justify-items: stretch; }

  /* Ritmo vertical estándar entre secciones */
  main > section:not(.hero):not(.page-hero) > .wrap { padding-top: var(--sec-y); padding-bottom: var(--sec-y); }
  .hero .wrap { padding-bottom: var(--sec-y); }
  .block > .wrap, .b-etapas > .wrap, .b-casos > .wrap, .b-tagline > .wrap { padding-top: var(--sec-y); padding-bottom: var(--sec-y); }

  /* Tarjetas de especialidad */
  .stack { gap: 16px; }
  /* Sin apilado sticky: tarjetas una tras otra, cada una se lee completa */
  .card { position: static; top: auto; padding: 20px; gap: 12px; box-shadow: 0 4px 16px rgba(3, 50, 67, .12); }
  .card-shade { display: none; }
  .card-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .card-n { font-size: 44px; line-height: 1; }
  .card-tag { font-size: 12px; line-height: 16px; }
  .card-art { align-self: flex-start; object-position: left center; width: min(55%, 200px); margin: 0; }
  .card h3 { font-size: 22px; line-height: 1.1; max-width: none; margin-top: 0; overflow-wrap: break-word; hyphens: auto; }
  .card p { font-size: 16px; line-height: 24px; }
  .card-bg { display: none; }

  /* Antes / después: sin tarjeta, ancho completo, en vertical */
  .prueba-panel { background: none; box-shadow: none; padding: 0; border-radius: 0; color: var(--arena); gap: 20px; }
  .prueba-panel .prueba-label { color: var(--aqua); font-size: 13px; }
  .prueba-collage { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .prueba-par-fotos { gap: 4px; border-radius: 12px; }
  .prueba-foto span { font-size: 12px; line-height: 16px; padding: 3px 8px; left: 8px; bottom: 8px; }
  .prueba-par figcaption { font-size: 16px; line-height: 22px; color: var(--arena); }

  /* Testimonios a ancho completo y legibles */
  .b-casos > .wrap { max-width: none; width: 100%; }
  .quotes { grid-template-columns: minmax(0, 1fr); }
  .quote { width: 100%; padding: 18px 16px; }
  .quote-name { font-size: 16px; line-height: 22px; }
  .quote-sub { font-size: 14px; line-height: 20px; }
  .quote p { font-size: 16px; line-height: 24px; }
  .b-casos > .wrap > .disclaimer { font-size: 14px; }

  /* Botón flotante: oculto en móvil (se navega con el menú) */
  .float { display: none !important; }

  footer .wrap { padding-top: 32px; }
}

/* Los <figure> traen margen lateral por defecto del navegador: aplastaba los testimonios */
.quote { margin: 0; }
html, body { overflow-x: clip; }

/* Textos legales: sin desbordes por palabras/URLs largas */
.legal-body > .wrap, .contact-body > .wrap { grid-template-columns: minmax(0, 1fr); }
.legal-body p, .legal-body li, .legal-body h2, .legal-body h3 { overflow-wrap: break-word; max-width: none; }
@media (max-width: 900px) { .legal-body h2 { font-size: 22px; } .legal-body p, .legal-body li { font-size: 16px; line-height: 24px; } }

/* Varios botones juntos: siempre en contenedor flex con separación (hero, especialidades, sobre mí…) */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Nota bajo un botón (p. ej. aviso de redirección) y botón de «Mostrar correo» */
.btn-note { font-size: 14px; line-height: 20px; opacity: .8; margin-top: -4px; }
.em-btn {
  font: inherit; font-weight: 600; color: var(--turquesa); background: none; border: 0; padding: 0;
  text-decoration: underline; cursor: pointer;
}
.em-btn:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.legal-body a[href^="mailto"], .contact-card a[href^="mailto"] { color: var(--turquesa); font-weight: 600; }

/* Cabeceras de página sin imagen ni vídeo (contacto, legales, 404): menos aire arriba */
.page-hero--plain { padding-top: 0; }
.page-hero--plain > .wrap { padding-block: 112px 40px !important; }
@media (max-width: 900px) { .page-hero--plain > .wrap { padding-block: 88px 24px !important; gap: 16px !important; } }

/* ---------- Blog (artículos): todo alineado a la izquierda en móvil ---------- */
@media (max-width: 768px) {
  .article-hero { justify-content: flex-start; text-align: left; }
  .article-hero .inner { justify-items: start; text-align: left; }
  .article-hero h1 { max-width: none; }
  .prose, .prose .lead, .prose p, .prose h2, .prose h3, .prose .aside-note, .prose .caption,
  .callout, .steps-soft li, .mid-cta, .related .wrap, .related a, .cta-band, .pull-band { text-align: left; }
  .prose, .callout, .steps-soft li, .mid-cta, .related .wrap, .related a, .cta-band .wrap { justify-items: stretch; }
  .steps-soft li { grid-template-columns: 1fr; }
  .mid-cta .btn { justify-self: stretch; }
  .related h2, .related h3, .cta-band h2 { margin-inline: 0; }
  footer .wrap, footer nav { justify-content: flex-start; text-align: left; }
}

/* Cabecera sobre fondo claro (índice del blog): texto oscuro hasta que se hace scroll */
header.top .bar { transition: background var(--dur-fade) var(--ease), box-shadow var(--dur-fade) var(--ease), color var(--dur-fade) var(--ease); }
header.top.header-light:not(.solid) .bar { background: rgba(249, 247, 241, .72); color: var(--mar); box-shadow: 0 4px 20px rgba(3, 50, 67, .08); }
header.top.header-light:not(.solid) nav a:not(.nav-cta) { opacity: 1; }
header.top.header-light:not(.solid) nav a:not(.nav-cta):hover { color: var(--turquesa); }
header.top.header-light:not(.solid) .nav-toggle { color: var(--mar); }
