/* OTEC Core — ajustes globales del sitio (R5, 2026-11-15).
   Se encola en todas las páginas, después de home.css, catalog.css y course.css.
   Cubre header, footer, motion, foco y WhatsApp. No cambia la paleta global de Blocksy. */

/* --------------------------------------------------------------------------
   1. Header
   -------------------------------------------------------------------------- */

#header [data-row="middle"] {
  --height: 88px;
}

#header [data-id="logo"] .site-logo-container {
  --logo-max-height: 56px;
}

#header [data-id="menu"] {
  --menu-indicator-hover-color: #ff9817;
  --menu-indicator-active-color: #ff9817;
  --menu-indicator-height: 3px;
}

/* Nav: tinta y subrayado naranja en hover/activo. */
#header .menu .ct-menu-link {
  color: rgba(15, 32, 55, 0.78) !important;
  font-weight: 600 !important;
}

#header .menu .current-menu-item > .ct-menu-link,
#header .menu .current_page_item > .ct-menu-link,
#header .menu .ct-menu-link:hover {
  color: #0f2037 !important;
}

#header .menu .ct-menu-link::after {
  height: 3px !important;
  background-color: #ff9817 !important;
}

/* CTA del header: reemplaza el #620526 de Blocksy. */
#header [data-id="button"] {
  --theme-button-background-initial-color: #ff9817;
  --theme-button-background-hover-color: #0f2037;
  --theme-button-text-initial-color: #0f2037;
  --theme-button-text-hover-color: #fbfbfb;
}

#header [data-id="button"] .ct-button {
  min-height: 44px !important;
  padding: 10px 22px !important;
  border-radius: 12px !important;
  background-color: #ff9817 !important;
  color: #0f2037 !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

#header [data-id="button"] .ct-button:hover {
  background-color: #0f2037 !important;
  color: #fbfbfb !important;
}

/* Menú móvil: objetivos táctiles de 44 px. */
#offcanvas .ct-menu-link {
  display: flex;
  align-items: center;
  min-height: 44px !important;
}

@media (max-width: 999.98px) {
  #header [data-row="middle"] {
    --height: 72px;
  }

  #header [data-id="logo"] .site-logo-container {
    --logo-max-height: 46px;
  }
}

@media (max-width: 689.98px) {
  #header [data-row="middle"] {
    --height: 64px;
  }

  #header [data-id="logo"] .site-logo-container {
    --logo-max-height: 38px;
  }

  #header [data-id="button"] .ct-button {
    min-height: 40px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
  }
}

/* --------------------------------------------------------------------------
   2. Footer
   -------------------------------------------------------------------------- */

/* Logo OTEC en fila completa; los 4 sellos en 4/3/2/1 columnas. */
#footer [data-row="middle"] > .ct-container {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  column-gap: clamp(24px, 3vw, 43px) !important;
  row-gap: 28px !important;
  align-items: center !important;
  justify-items: center !important;
}

#footer [data-row="middle"] [data-column="widget-area-5"] {
  grid-column: 1 / -1;
  justify-self: start;
}

#footer [data-row="middle"] [data-column="ghost"] {
  display: none !important;
}

#footer [data-row="middle"] [data-column] {
  width: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
}

#footer [data-row="middle"] [data-column="widget-area-5"] {
  align-items: flex-start !important;
}

#footer [data-row="middle"] .ct-widget {
  width: 100%;
  margin: 0 !important;
}

/* Vence los width/height inline de Greenshift y los sellos gigantes. */
#footer [data-row="middle"] img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 62px !important;
  margin-inline: auto !important;
  object-fit: contain !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

@media (max-width: 999.98px) {
  #footer [data-row="middle"] > .ct-container {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  #footer [data-row="middle"] img {
    max-height: 48px !important;
  }

  #footer [data-row="middle"] [data-column="widget-area-5"] {
    justify-self: center;
    align-items: center !important;
  }
}

@media (min-width: 768px) and (max-width: 999.98px) {
  /* 3 columnas con 4 sellos: el cuarto se centra en la segunda fila. */
  #footer [data-row="middle"] [data-column="widget-area-2"] {
    grid-column: 2 / 3;
  }
}

@media (max-width: 767.98px) {
  #footer [data-row="middle"] > .ct-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 479.98px) {
  #footer [data-row="middle"] > .ct-container {
    grid-template-columns: 1fr !important;
  }
}

/* Legal: una sola fila centrada. */
#footer [data-row="bottom"] > .ct-container {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
}

#footer [data-row="bottom"] [data-column="ghost"] {
  display: none !important;
}

#footer .ct-footer-copyright {
  color: rgba(251, 251, 251, 0.72) !important;
  font-size: 14px !important;
  text-align: center !important;
}

#footer .ct-footer-copyright a {
  color: inherit !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Motion
   -------------------------------------------------------------------------- */

@keyframes otec-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    body.home .otec-como,
    body.home .otec-confianza,
    body.home .otec-cta-final,
    body.single-curso .otec-modulos {
      animation: otec-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .otec-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .otec-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 32, 55, 0.24) !important;
    box-shadow: 0 18px 36px rgba(15, 32, 55, 0.12);
  }
}

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

  body.home .otec-como,
  body.home .otec-confianza,
  body.home .otec-cta-final,
  body.single-curso .otec-modulos {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .otec-card {
    transition: none !important;
  }

  .otec-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* AOS sigue intacto; solo se neutraliza bajo reduced motion. */
  body.home [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .otec-chip,
  .otec-card__img,
  .otec-card__cta,
  .otec-card__wa,
  #header .ct-header-cta a.ct-button,
  .otec-sticky-cta {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   4. Foco visible
   -------------------------------------------------------------------------- */

#header a:focus-visible,
#header button:focus-visible,
#offcanvas a:focus-visible,
#footer a:focus-visible,
.otec-chip:focus-visible,
.otec-card__media:focus-visible,
.otec-card__title a:focus-visible,
.otec-card__cta:focus-visible,
.otec-card__wa:focus-visible,
.gspb_slider-id-gsbp-b9a9a27 .swiper-button-prev:focus-visible,
.gspb_slider-id-gsbp-b9a9a27 .swiper-button-next:focus-visible,
.gs_click_sync:focus-visible,
#ht-ctc-chat:focus-visible {
  outline: 3px solid #ff9817 !important;
  outline-offset: 3px !important;
}

/* CTA sobre naranja: anillo de tinta para que se distinga. */
#header [data-id="button"] .ct-button:focus-visible,
.otec-card__cta:focus-visible {
  outline-color: #0f2037 !important;
}

/* CTA final sobre la banda de tinta: anillo claro. */
body.home .otec-cta-final__primary:focus-visible {
  outline-color: #fbfbfb !important;
}

/* La media de la tarjeta recorta el outline; usar offset interior. */
.otec-card__media:focus-visible {
  outline-offset: -3px !important;
}

.otec-card:focus-within {
  border-color: #ff9817 !important;
  box-shadow: 0 0 0 3px rgba(255, 152, 23, 0.35);
}

/* --------------------------------------------------------------------------
   5. WhatsApp
   -------------------------------------------------------------------------- */

/* El SVG del plugin usa un gradiente verde inline; el path blanco se conserva. */
#ht-ctc-chat svg use {
  fill: #ff9817 !important;
}

#ht-ctc-chat .ctc_cta {
  background-color: #0f2037 !important;
  color: #fbfbfb !important;
}
