/* ==========================================================================
   NicaSalud — capa de tema (garabatos, animaciones y ajustes mobile-first)
   Se carga DESPUÉS de style.css para no romper el diseño original.
   ========================================================================== */

:root {
  --nica-doodle: var(--theme-color1);
  --nica-doodle-2: var(--theme-color3);
  --nica-doodle-3: var(--theme-color4);
}

/* --------------------------------------------------------------------------
   1. Garabatos (doodles SVG)
   -------------------------------------------------------------------------- */
.garabato {
  display: inline-block;
  vertical-align: middle;
  color: var(--nica-doodle);
  pointer-events: none;
  will-change: transform;
}

.garabato-abs {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

/* Envoltorio relativo para sembrar garabatos dentro de una sección */
.garabato-capa {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.garabato-capa + * {
  position: relative;
  z-index: 1;
}

/* Subrayado dibujado a mano para títulos */
.nica-underline {
  position: relative;
  display: inline-block;
}
.nica-underline::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.12em;
  height: 0.34em;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'><path d='M3 14C40 4 76 3 112 9c28 4.6 55 4 85-3' fill='none' stroke='%2335e0ea' stroke-width='5' stroke-linecap='round'/></svg>");
  opacity: 0.9;
}

/* Círculo garabateado alrededor de una palabra */
.nica-circulo {
  position: relative;
  display: inline-block;
  padding: 0 0.18em;
}
.nica-circulo::before {
  content: '';
  position: absolute;
  inset: -0.24em -0.34em -0.2em;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 90' preserveAspectRatio='none'><path d='M168 12C120-2 34 2 12 30c-20 26 6 53 66 55 58 2 110-8 116-30 5-19-18-32-60-36-52-5-104 6-118 30' fill='none' stroke='%23f05da8' stroke-width='3.5' stroke-linecap='round'/></svg>");
}

/* Separador con forma de garabato (para entre secciones) */
.nica-separador {
  display: block;
  width: min(280px, 70%);
  margin: 0 auto;
  height: auto;
  color: var(--theme-color3);
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   2. Animaciones extra (se suman a wow.js / AOS del template)
   -------------------------------------------------------------------------- */
@keyframes nica-flotar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}
@keyframes nica-girar {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes nica-latir {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.14); }
  40% { transform: scale(0.97); }
  60% { transform: scale(1.08); }
  80% { transform: scale(0.99); }
}
@keyframes nica-brincar {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-6px); }
}
@keyframes nica-balancear {
  0%, 100% { transform: rotate(-7deg) translateY(0); }
  50% { transform: rotate(7deg) translateY(-6px); }
}
@keyframes nica-dibujar {
  from { stroke-dashoffset: var(--nica-trazo, 400); }
  to { stroke-dashoffset: 0; }
}

.anim-flotar { animation: nica-flotar 5s ease-in-out infinite; }
.anim-girar { animation: nica-girar 22s linear infinite; }
.anim-latir { animation: nica-latir 3.2s ease-in-out infinite; }
.anim-brincar { animation: nica-brincar 4s ease-in-out infinite; }
.anim-balancear { animation: nica-balancear 6s ease-in-out infinite; }
.anim-retraso-1 { animation-delay: 0.6s; }
.anim-retraso-2 { animation-delay: 1.2s; }
.anim-retraso-3 { animation-delay: 1.8s; }

/* Trazo que se dibuja solo cuando entra en pantalla */
.garabato-dibujado path,
.garabato-dibujado circle {
  stroke-dasharray: var(--nica-trazo, 400);
  stroke-dashoffset: var(--nica-trazo, 400);
  animation: nica-dibujar 2.4s ease-out forwards;
}

/* --------------------------------------------------------------------------
   2b. Ajustes de titulación para español
   El original usa palabras cortas en inglés ("Home", "Nursing") que caben a
   8vw; en español necesitamos titulares algo más compactos para que no se
   partan mal en pantallas grandes.
   -------------------------------------------------------------------------- */
.banner-section .banner-title {
  font-size: clamp(32px, 4.4vw, 68px) !important;
  line-height: 1.05;
}
.banner-section .outer-box .outer-container .banner-content .inner-content .content {
  padding-left: 104px !important;
}
@media (max-width: 1199.98px) {
  .banner-section .outer-box .outer-container .banner-content .inner-content .content {
    padding-left: 84px !important;
  }
}
@media (max-width: 991.98px) {
  .banner-section .outer-box .outer-container .banner-content .inner-content .content {
    padding-left: 0 !important;
  }
}

.banner-section-two .banner-title {
  font-size: clamp(30px, 4.4vw, 72px) !important;
  line-height: 1.05;
}

/* --------------------------------------------------------------------------
   2c. Header sobre fondo claro (páginas sin banner oscuro, p. ej. 404)
   -------------------------------------------------------------------------- */
.logo-for-light {
  display: none;
}
.page-light .logo-for-dark {
  display: none;
}
.page-light .logo-for-light {
  display: inline-block;
}
.page-light .main-header .main-menu .navigation > li > a {
  color: var(--headings-color);
}
.page-light .main-header .main-menu .navigation > li > a:hover {
  color: var(--theme-color1);
}
.page-light .main-header .search-btn {
  color: var(--headings-color);
}
.page-light .main-header .search-btn:hover {
  color: var(--theme-color1);
}

/* Nombres largos del equipo: dejar hueco al botón de compartir */
.team-block .team-content .title {
  padding-right: 56px;
}

/* --------------------------------------------------------------------------
   3. Ajustes mobile-first (refuerzan la respuesta del template)
   -------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
}

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

/* Las imágenes decorativas nunca deben provocar scroll horizontal */
.garabato-abs,
.garabato-capa {
  max-width: 100%;
}

/* Foco visible para navegación con teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--theme-color1);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 767.98px) {
  /* Más aire en móvil y títulos algo más contenidos */
  .section-padding {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

  .sec-title {
    margin-bottom: 28px !important;
  }

  /* Los garabatos decorativos se reducen para no invadir el contenido */
  .garabato-abs {
    opacity: 0.55;
    transform: scale(0.75);
  }

  /* Botones y campos táctiles cómodos (mínimo 44px) */
  .theme-btn,
  .btn-more,
  .submit-btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .anim-flotar,
  .anim-girar,
  .anim-latir,
  .anim-brincar,
  .anim-balancear,
  .garabato-dibujado path,
  .garabato-dibujado circle {
    animation: none !important;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
