/* ============================================================
   SMC — Capa del sitio público (saracosme.com)
   Se enlaza desde la parte de plantilla del header, justo después
   de smc-styles.css. Los selectores llevan "body" para ganarle
   también al CSS adicional de los estilos globales.
   ============================================================ */

:root {
  --smc-nav-h: 72px; /* alto del header pegajoso: lo usan los anclajes y la landing */
}

/* smc-styles.css pone overflow-x: hidden en html y body: eso vuelve al body un
   contenedor de scroll y rompe position: sticky. clip corta igual sin ese efecto. */
:root { overflow-x: clip; }
html body { overflow-x: clip; }

/* Los anclajes (#agendar, #ubicacion) y scrollIntoView no quedan bajo el header */
html {
  scroll-padding-top: calc(var(--smc-nav-h) + 12px);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ===== Header (parte de plantilla "header", bloques de WordPress) =====
   Pegajoso en vez de fijo: ocupa su lugar en la página, así que ya no se
   come el contenido de ninguna plantilla. */
/* El pegado va en el contenedor de la parte de plantilla: el grupo interior
   mide lo mismo que él y no tendría recorrido para deslizarse. */
body .wp-site-blocks > header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 20;
}

body .smc-header {
  gap: 1.5rem;
  padding: 0.9rem clamp(20px, 5vw, 50px);
  /* Fondo sólido a propósito: backdrop-filter crearía un bloque contenedor y
     dejaría el menú desplegable de móvil encerrado dentro del header. */
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(196, 162, 101, 0.35);
}

body .smc-header .wp-block-site-logo img {
  width: clamp(120px, 18vw, 170px);
  height: auto;
}

body .smc-header .wp-block-navigation {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body .smc-header .wp-block-navigation a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.25s ease;
}

body .smc-header .wp-block-navigation a:hover { color: #a8864d; }

/* Menú desplegable en móvil */
body .smc-header .wp-block-navigation__responsive-container-open,
body .smc-header .wp-block-navigation__responsive-container-close { color: #1a1a1a; }

body .wp-block-navigation__responsive-container.is-menu-open {
  padding: clamp(2rem, 8vw, 4rem);
  background: #ffffff;
}

body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  gap: 1.8rem;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
}

body .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
  justify-content: center;
  align-items: center;
}


/* ===== Calendly: el contenedor crece con el widget =====
   data-resize="true" hace que widget.js ajuste la altura con el evento
   calendly.page_height. Mientras carga reporta 2px, por eso el mínimo. */
body .smc-calendly-wrapper {
  min-height: 0;
}

body .calendly-inline-widget[data-resize="true"] {
  min-height: 700px;
}

/* ===== Portada: el subtítulo del hero ahora es el H1 ===== */
body h1.smc-hero-tagline {
  margin-top: 0;
  line-height: 1.5;
  text-transform: none;
}

/* ===== Contenido visible por defecto (incidente del 23 sep 2026) =====
   smc-styles.css y el CSS adicional de los estilos globales ocultan todo
   .smc-reveal y colapsan los acordeones hasta que el JS actúe. Cuando
   smc.js dejó de correr, la portada quedó en blanco bajo el hero y
   /riesgos/ no se podía leer. Ahora solo se oculta si smc.js ya arrancó
   y marcó <html> con .smc-js-reveal / .smc-js-acc. */
html body .smc-reveal {
  opacity: 1;
  transform: none;
}

html.smc-js-reveal body .smc-reveal:not(.visible) {
  opacity: 0;
  transform: translateY(30px);
}

/* La sección de citas nunca se anima: es la que convierte. */
html body #agendar .smc-reveal,
html body .smc-calendly-wrapper,
html body .calendly-inline-widget {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* Acordeones (/riesgos/ y servicios): abiertos salvo que el JS los controle. */
html body .smc-service-body {
  max-height: none;
  padding: 1.5rem;
}

/* Abierto sin tope: el max-height: 600px original cortaba textos largos. */
html body .smc-service-block.open .smc-service-body {
  max-height: none;
}

html.smc-js-acc body .smc-service-block:not(.open) .smc-service-body {
  max-height: 0;
  padding: 0 1.5rem;
}

html body .smc-service-header:focus-visible {
  outline: 2px solid #c4a265;
  outline-offset: 2px;
}

/* Enlace directo a Calendly bajo el widget (por si el iframe no carga) */
body .smc-calendly-fallback {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.8rem;
}

body .smc-calendly-fallback a { color: #a8864d; }
