/* ==========================================================================
   CONSULTA DE PSICOLOGÍA - HOJA DE ESTILOS PRINCIPAL
   Dirección de arte: Calma orgánica, rigor sanitario, alta legibilidad
   ========================================================================== */

:root {
  /* Paleta cromática cálida y contrastada (WCAG AAA) */
  --color-bg-ivory: #FAF8F5;
  --color-bg-white: #FFFFFF;
  --color-bg-sand: #F2EFE9;
  --color-bg-sand-light: #F8F6F2;
  --color-bg-sand-dark: #E4DDD2;

  /* Verdes salvia botánicos (calma, naturaleza, anclaje terapéutico) */
  --color-sage: #5A725D;
  --color-sage-dark: #3E5141;
  --color-sage-deep: #2A382C;
  --color-sage-light: #EBF1EC;
  --color-sage-border: #CBD9CD;

  /* Terracota cálido (humanidad, vitalidad y llamada a la acción) */
  --color-terracotta: #C46851;
  --color-terracotta-hover: #AB543F;
  --color-terracotta-soft: #F9EFEB;
  --color-terracotta-border: #E8BFB5;

  /* Grafito y escala de texto */
  --color-text-main: #1F2521;
  --color-text-muted: #535E55;
  --color-text-subtle: #738075;
  --color-border: #E2DBD0;
  --color-border-subtle: #EDE7DD;

  /* Alertas sanitarias y urgencias */
  --color-alert-bg: #FDF4E7;
  --color-alert-border: #F3CE98;
  --color-alert-text: #784712;

  /* Tipografía */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Escala tipográfica fluida */
  --text-xs: clamp(0.75rem, 0.2vw + 0.7rem, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.3vw + 0.8rem, 0.9375rem);
  --text-base: clamp(1rem, 0.35vw + 0.92rem, 1.1rem);
  --text-lg: clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
  --text-xl: clamp(1.3rem, 0.8vw + 1.1rem, 1.55rem);
  --text-2xl: clamp(1.65rem, 1.4vw + 1.3rem, 2.1rem);
  --text-3xl: clamp(2.1rem, 2.2vw + 1.6rem, 2.9rem);
  --text-hero: clamp(2.5rem, 3.8vw + 1.6rem, 4.1rem);

  /* Espaciado */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-4xl: 6.5rem;

  /* Bordes redondeados orgánicos */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* Sombras sutiles */
  --shadow-sm: 0 2px 8px rgba(31, 37, 33, 0.04);
  --shadow-md: 0 12px 30px -6px rgba(31, 37, 33, 0.07);
  --shadow-lg: 0 24px 48px -12px rgba(31, 37, 33, 0.1);
  --shadow-glow: 0 0 0 4px var(--color-sage-light);

  /* Transiciones */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  /* Ancho de contenedor */
  --container-max: 1220px;
  --container-narrow: 840px;
}

/* Reset moderno y caja universal */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text-main);
  background-color: var(--color-bg-ivory);
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  background-image: radial-gradient(circle at 10% 20%, rgba(94, 114, 97, 0.03) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(196, 104, 81, 0.025) 0%, transparent 40%);
}

/* Accesibilidad: Foco visible de teclado */
:focus-visible {
  outline: 3px solid var(--color-terracotta);
  outline-offset: 3px;
}

/* Accesibilidad: Salto al contenido principal */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1.5rem;
  background-color: var(--color-sage-dark);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 10000;
  transition: top var(--transition-fast);
  text-decoration: none;
}
.skip-to-content:focus {
  top: 1rem;
}

/* Tipografía base */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-text-main);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-sm); }
h4 { font-size: var(--text-xl); }

p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-md);
  font-weight: 400;
}

p.lead {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-text-main);
}

a {
  color: var(--color-sage-dark);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-terracotta);
}

/* Contenedores de diseño */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

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

.section {
  padding-block: var(--space-3xl);
  position: relative;
}

@media (min-width: 992px) {
  .section {
    padding-block: var(--space-4xl);
  }
}

.section-alt {
  background-color: var(--color-bg-sand);
}

.section-sage {
  background-color: var(--color-sage-light);
}

/* Encabezados de sección con estilo editorial */
.section-header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-2xl);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-sage-dark);
  background-color: var(--color-sage-light);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--color-sage-border);
}

.section-tag-terracotta {
  color: var(--color-terracotta);
  background-color: var(--color-terracotta-soft);
  border-color: var(--color-terracotta-border);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* Iconos SVG inline */
.icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 0;
  stroke: currentColor;
  fill: currentColor;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Elementos de ayuda editables [NOMBRE], [CIUDAD], etc. */
.editable-hint {
  background-color: rgba(196, 104, 81, 0.12);
  color: #8C3925;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  border-bottom: 1.5px dashed var(--color-terracotta);
  cursor: help;
  position: relative;
}
.editable-hint:hover::after {
  content: "Dato configurable antes de publicar";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-sage-deep);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

/* Respeto de preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
