/*
Theme Name: Sercoinf
Theme URI: https://asesoriasercoinf.com
Author: Asesoría Sercoinf
Description: Tema a medida para Asesoría Sercoinf (León) — asesoría fiscal, laboral y contable. Diseño de alta fidelidad basado en el sistema de diseño de la marca (azul #1C409C / navy #001845, Poppins + IBM Plex). Home, páginas de servicio y blog orientados a captar contactos por WhatsApp, email y teléfono.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sercoinf
*/

/* ============================================================
   SERCOINF — TOKENS DEL SISTEMA DE DISEÑO
   (colores, tipografía, espaciado y efectos de la marca)
   ============================================================ */
:root {
  /* ---- Azul de marca ---- */
  --blue-50:  #eef2fb;
  --blue-100: #d6e0f5;
  --blue-200: #adc0ea;
  --blue-300: #7d99dc;
  --blue-400: #4a6dc4;
  --blue-500: #1c409c;   /* brand blue */
  --blue-600: #173687;
  --blue-700: #122a6a;
  --blue-800: #0d1f4f;
  --blue-900: #091638;

  /* ---- Navy ---- */
  --navy-500: #001845;
  --navy-600: #001236;
  --navy-700: #000d28;

  /* ---- Grises (neutro cálido) ---- */
  --gray-0:   #ffffff;
  --gray-50:  #f8f7f3;
  --gray-100: #f0eee8;
  --gray-200: #e4e1d8;
  --gray-300: #cfcabf;
  --gray-400: #9c988d;
  --gray-500: #6e6a60;
  --gray-600: #504d45;
  --gray-700: #403e38;
  --gray-800: #2a2c30;
  --gray-900: #18191c;
  --black:    #000000;

  /* ---- Semánticos ---- */
  --green-50:  #e9f6ee;
  --green-500: #1f8a4c;
  --green-600: #167040;
  --amber-50:  #fdf3e3;
  --amber-500: #c8841a;
  --amber-600: #a66c10;
  --red-50:    #fbeaea;
  --red-500:   #c0392b;
  --red-600:   #9e2c20;

  /* ---- Aliases semánticos ---- */
  --text-strong:   var(--navy-500);
  --text-body:     var(--gray-700);
  --text-muted:    var(--gray-500);
  --text-inverse:  #ffffff;
  --text-link:     var(--blue-500);
  --text-on-brand: #ffffff;

  --surface-page:    var(--gray-50);
  --surface-card:    #ffffff;
  --surface-subtle:  var(--gray-100);
  --surface-brand:   var(--blue-500);
  --surface-navy:    var(--navy-500);
  --surface-inverse: var(--navy-500);

  --border-subtle:  var(--gray-200);
  --border-default: var(--gray-300);
  --border-strong:  var(--gray-400);
  --border-brand:   var(--blue-500);

  --brand:          var(--blue-500);
  --brand-hover:    var(--blue-600);
  --brand-active:   var(--blue-700);
  --brand-soft:     var(--blue-50);

  --success:       var(--green-500);
  --success-soft:  var(--green-50);
  --warning:       var(--amber-500);
  --warning-soft:  var(--amber-50);
  --danger:        var(--red-500);
  --danger-soft:   var(--red-50);
  --info:          var(--blue-500);
  --info-soft:     var(--blue-50);

  --gradient-brand: linear-gradient(135deg, var(--blue-500) 0%, var(--navy-500) 100%);
  --gradient-ink:   linear-gradient(135deg, var(--navy-500) 0%, var(--gray-900) 100%);
  --gradient-soft:  linear-gradient(160deg, var(--gray-50) 0%, var(--blue-50) 100%);

  /* ---- Tipografía ---- */
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extra:    800;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.375rem;
  --text-xl:   1.75rem;
  --text-2xl:  2.25rem;
  --text-3xl:  2.875rem;
  --text-4xl:  3.75rem;

  --leading-tight:   1.1;
  --leading-snug:    1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.65;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-caps:   0.14em;

  /* ---- Espaciado / radios ---- */
  --space-0:  0;
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-7:  2.5rem;
  --space-8:  3rem;
  --space-9:  4rem;
  --space-10: 5rem;
  --space-12: 7.5rem;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --container-sm:  640px;
  --container-md:  860px;
  --container-lg:  1080px;
  --container-xl:  1280px;

  /* ---- Sombras / motion (tintadas en navy) ---- */
  --shadow-xs:  0 1px 2px rgba(0, 24, 69, 0.06);
  --shadow-sm:  0 1px 3px rgba(0, 24, 69, 0.08), 0 1px 2px rgba(0, 24, 69, 0.04);
  --shadow-md:  0 4px 12px rgba(0, 24, 69, 0.08), 0 2px 4px rgba(0, 24, 69, 0.04);
  --shadow-lg:  0 12px 28px rgba(0, 24, 69, 0.10), 0 4px 10px rgba(0, 24, 69, 0.05);
  --shadow-xl:  0 24px 48px rgba(0, 24, 69, 0.14);

  --focus-ring: 0 0 0 3px rgba(28, 64, 156, 0.30);

  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:   120ms;
  --dur-normal: 200ms;
  --dur-slow:   320ms;

  --sc-container: 1180px;
}

/* ============================================================
   RESET LIGERO / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
  background: var(--surface-page);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

/* Seleccion de texto tipo rotulador (el mismo ambar del marcador del hero) */
::selection { background: rgba(255,199,64,0.5); color: var(--navy-500); }

/* Ancla de scroll bajo la cabecera pegajosa */
:target { scroll-margin-top: 90px; }

/* Salto al contenido: oculto hasta que el teclado lo enfoca */
.sc-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--brand);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-md) 0;
}
.sc-skip:focus {
  left: 0;
  outline: 3px solid var(--navy-500);
  outline-offset: 2px;
}

/* Foco visible y consistente en todo lo interactivo */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ============================================================
   BOTONES (recreación fiel del componente Button del sistema)
   ============================================================ */
.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: background var(--dur-normal) var(--ease-standard),
              border-color var(--dur-normal) var(--ease-standard),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-standard);
}
/* Los botones responden al tacto: pequena elevacion al pasar y clic al pulsar */
.sc-btn:hover  { transform: translateY(-1px); }
.sc-btn:active { transform: translateY(0) scale(0.99); }
.sc-btn--primary:hover { box-shadow: 0 10px 22px rgba(28, 64, 156, 0.25); }
.sc-btn__icon { display: inline-flex; font-size: 1.1em; }
.sc-btn--sm { font-size: var(--text-sm);   padding: 8px 14px;  gap: 6px;  border-radius: var(--radius-sm); }
.sc-btn--md { font-size: var(--text-base); padding: 11px 20px; gap: 8px; }
.sc-btn--lg { font-size: var(--text-md);   padding: 15px 28px; gap: 10px; }
.sc-btn--full { width: 100%; }
.sc-btn--primary   { background: var(--brand); color: #fff; border-color: var(--brand); }
.sc-btn--primary:hover   { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.sc-btn--secondary { background: #fff; color: var(--navy-500); border-color: var(--border-default); }
.sc-btn--secondary:hover { background: var(--gray-50); border-color: var(--border-strong); }
.sc-btn--navy      { background: var(--navy-500); color: #fff; border-color: var(--navy-500); }
.sc-btn--navy:hover      { background: var(--navy-600); border-color: var(--navy-600); color: #fff; }
.sc-btn--ghost     { background: transparent; color: var(--brand); }
.sc-btn--ghost:hover     { background: var(--brand-soft); }

/* ============================================================
   NAV / CABECERA
   ============================================================ */
.sc-navlink { position: relative; transition: color var(--dur-fast) var(--ease-standard); }
.sc-navlink:hover { color: var(--brand); }
.sc-navlink--active { color: var(--brand); }
/* Subrayado que se dibuja de izquierda a derecha al pasar el raton */
.sc-navlink::after {
  content: "";
  position: absolute; left: 1px; right: 1px; bottom: -6px; height: 2.5px;
  border-radius: 2px; background: var(--brand);
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur-normal) var(--ease-out);
}
.sc-navlink:hover::after,
.sc-navlink--active::after { transform: scaleX(1); }

/* Desplegable de Servicios en la cabecera */
.sc-has-sub { position: relative; }
.sc-submenu {
  position: absolute; top: 100%; left: -18px; z-index: 60;
  padding-top: 14px;           /* puente invisible para no perder el hover */
  display: none;
}
.sc-has-sub:hover .sc-submenu,
.sc-has-sub:focus-within .sc-submenu { display: block; }
.sc-submenu-in {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 260px;
  display: flex; flex-direction: column;
}
.sc-submenu-in a {
  font-family: var(--font-body); font-size: 14.5px; color: var(--text-body);
  padding: 10px 14px; border-radius: var(--radius-sm);
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.sc-submenu-in a:hover { background: var(--brand-soft); color: var(--brand); }

.sc-menu-toggle { display: none; }
.sc-mobile-nav { display: none; }

/* CTA de WhatsApp visible en la cabecera SOLO en móvil (donde no cabe el botón) */
.sc-mobile-cta {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand); color: #fff;
  align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease-standard);
}
.sc-mobile-cta:hover { background: var(--brand-hover); }

/* ============================================================
   BOTÓN FLOTANTE DE WHATSAPP (toda la web)
   ============================================================ */
.sc-wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: background var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
}
.sc-wa-float:hover { background: #1fb857; transform: translateY(-2px); box-shadow: var(--shadow-xl); }
@media print { .sc-wa-float { display: none !important; } }

/* ============================================================
   AVISO DE COOKIES (solo si hay Google Analytics configurado)
   ============================================================ */
.sc-cookies {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70;
  max-width: 720px; margin: 0 auto;
  flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--navy-500); color: #fff;
  border-radius: var(--radius-lg); padding: 18px 22px;
  box-shadow: var(--shadow-xl);
}
.sc-cookies p {
  margin: 0; flex: 1 1 320px;
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  color: rgba(255,255,255,0.9);
}
.sc-cookies a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.sc-cookies-botones { display: flex; gap: 10px; }
@media print { .sc-cookies { display: none !important; } }

/* ============================================================
   TARJETAS DE CONTACTO / FAQ
   ============================================================ */
.sc-contact-card {
  transition: border-color var(--dur-normal) var(--ease-standard),
              box-shadow var(--dur-normal) var(--ease-standard);
}
.sc-contact-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }

details.sc-faq > summary { list-style: none; cursor: pointer; }
details.sc-faq > summary::-webkit-details-marker { display: none; }
details.sc-faq[open] .sc-faq-chev { transform: rotate(180deg); }
/* Enlaces dentro de las respuestas (a páginas de servicio) */
details.sc-faq a { color: var(--brand); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
details.sc-faq a:hover { color: var(--brand-hover); }

input:focus, textarea:focus, select:focus {
  border-color: var(--brand) !important;
  box-shadow: var(--focus-ring);
}

/* ============================================================
   ARTÍCULO DE BLOG (tipografía del contenido)
   ============================================================ */
.sc-article p { font-family: var(--font-body); font-size: 18px; line-height: 1.72; color: var(--text-body); margin: 0 0 22px; }
.sc-article h2 { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; color: var(--navy-500); margin: 44px 0 16px; }
.sc-article h3 { font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.25; color: var(--navy-500); margin: 32px 0 12px; }
.sc-article ul, .sc-article ol { margin: 0 0 22px; padding-left: 4px; display: flex; flex-direction: column; gap: 12px; list-style: none; }
.sc-article ul li { display: flex; gap: 12px; font-family: var(--font-body); font-size: 18px; line-height: 1.6; color: var(--text-body); }
.sc-article ul li::before { content: "\2713"; color: var(--brand); font-weight: 700; flex: 0 0 auto; }
.sc-article ol { counter-reset: sc; }
.sc-article ol li { display: flex; gap: 14px; font-family: var(--font-body); font-size: 18px; line-height: 1.6; color: var(--text-body); counter-increment: sc; }
.sc-article ol li::before { content: counter(sc); flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-family: var(--font-display); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.sc-article a { color: var(--brand); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.sc-article strong { color: var(--text-strong); font-weight: 600; }
.sc-article img { border-radius: 16px; margin: 8px 0 28px; }
.sc-article figure { margin: 0 0 28px; }
.sc-article figcaption { font-size: 14px; color: var(--text-muted); margin-top: 8px; text-align: center; }
.sc-toc a { display: block; font-family: var(--font-body); font-size: 14.5px; color: var(--text-body); line-height: 1.4; transition: color var(--dur-fast) var(--ease-standard); }
.sc-toc a:hover { color: var(--brand); }

/* ============================================================
   UTILIDADES DE REJILLA (rejillas del prototipo)
   ============================================================ */
.sc-card-link { display: block; height: 100%; }

/* Tarjetas-enlace: pequeña elevación al pasar el ratón (motion sobrio de la marca) */
.sc-card-link > div,
.sc-3col > a:not(.sc-card-link) {
  transition: box-shadow var(--dur-normal) var(--ease-standard),
              transform var(--dur-normal) var(--ease-standard);
}
.sc-card-link:hover > div,
.sc-3col > a:not(.sc-card-link):hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.sc-card-link:hover .sc-card-arrow { transform: translateX(4px); }
.sc-card-link:hover .sc-card-cta { text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   ANIMACIÓN DE APARICIÓN (fades cortos, según sistema de diseño)
   La clase .sc-anim la añade JS; sin JS todo se ve normal.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* Doble clase a propósito: gana a la transición del hover en tarjetas-enlace */
  .sc-anim.sc-anim {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out),
                box-shadow var(--dur-normal) var(--ease-standard);
  }
  .sc-anim.sc-anim.is-visible { opacity: 1; transform: none; }
  /* Mantener la elevación de hover solo en tarjetas que son enlaces */
  a.sc-anim.is-visible:not(.sc-card-link):hover { transform: translateY(-2px); }
}

/* ============================================================
   TOQUES HUMANOS (v1.2): marcador, notas a mano, papel y foto
   ============================================================ */
/* Subrayado tipo rotulador ambar en palabras clave del titular */
.sc-marker {
  background-image: linear-gradient(100deg,
    rgba(255,199,64,0) 0.8%, rgba(255,199,64,0.55) 3%,
    rgba(255,193,54,0.4) 50%, rgba(255,199,64,0.55) 96%, rgba(255,199,64,0) 99%);
  background-size: 100% 42%;
  background-position: 0 76%;
  background-repeat: no-repeat;
}

/* Nota al margen: cursiva discreta de la marca (IBM Plex) */
.sc-hand {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  display: inline-block;
}
.sc-hand--brand { color: var(--brand); }

/* Grano de papel muy sutil (textura sobre el hero) */
.sc-grain { position: relative; }
.sc-grain::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}

/* Foto pinada: leve giro que se endereza al pasar, con mancha organica detras */
.sc-photo-tilt {
  position: relative;
  transform: rotate(-1.5deg);
  transition: transform var(--dur-slow) var(--ease-out);
}
.sc-photo-tilt:hover { transform: rotate(0deg); }
.sc-photo-tilt::before {
  content: "";
  position: absolute; inset: -16px -12px -20px -16px; z-index: 0;
  background: linear-gradient(140deg, var(--blue-50) 0%, rgba(255,199,64,0.28) 100%);
  border-radius: 58% 42% 55% 45% / 46% 55% 45% 54%;
  transform: rotate(2.5deg);
}
.sc-photo-tilt > img { position: relative; z-index: 1; }

/* ============================================================
   PAGINACIÓN DEL BLOG
   ============================================================ */
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: var(--radius-pill);
  background: #fff; color: var(--navy-500);
  border: 1px solid var(--border-default); text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.pagination .page-numbers.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination a.page-numbers:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .page-numbers.dots { border: none; background: transparent; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sc-hero-grid { grid-template-columns: 1fr !important; }
  .sc-2col { grid-template-columns: 1fr !important; }
  .sc-3col { grid-template-columns: 1fr !important; }
  .sc-footer-grid { grid-template-columns: 1fr !important; }
  .sc-article-grid { grid-template-columns: 1fr !important; }
  .sc-article-grid aside { position: static !important; }

  .sc-nav-links { display: none !important; }
  .sc-mobile-cta { display: inline-flex; }
  .sc-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--border-default);
    border-radius: var(--radius-md); background: #fff; color: var(--navy-500); cursor: pointer;
  }

  /* Banda de valores en 1 columna: quitar el separador lateral */
  .sc-value-mid { border-left: none !important; padding-left: 0 !important; }

  /* Selector de servicios: carrusel horizontal deslizable en móvil */
  .sc-pills {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px !important;
  }
  .sc-pills::-webkit-scrollbar { display: none; }
  .sc-mobile-nav { display: none; }
  .sc-mobile-nav.is-open { display: flex; }

  /* Reducir tamaños de titular en móvil */
  .sc-h1-hero { font-size: 34px !important; }
  .sc-h2 { font-size: 28px !important; }
  .sc-pad-hero { padding-top: 44px !important; padding-bottom: 52px !important; }
  .sc-pad-section { padding-top: 56px !important; }
  .sc-panel-lg { padding: 32px !important; }
}

@media (max-width: 560px) {
  .sc-h1-hero { font-size: 29px !important; }
  .sc-header-inner { padding-left: 18px !important; padding-right: 18px !important; }
  .sc-section { padding-left: 18px !important; padding-right: 18px !important; }

  /* Botones grandes a ancho completo: no desbordan y son más fáciles de pulsar */
  .sc-btn--lg { width: 100%; }
  .sc-wa-float { right: 16px; bottom: 16px; }
}
