/**
 * Grupo FAM - Global Animation System & Design Tokens for Elementor Widgets
 * Color institucional: #212c5d (Azul FAM TEAM)
 */

@font-face {
  font-family: 'Editorial';
  src: url('../fonts/editorial-sans.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fam-paper: #f8f8f6;
  --fam-ink: #171717;
  --fam-muted: #62625d;
  --fam-line: #d6d6d0;
  --fam-accent: #212c5d;
  --fam-accent-fg: #ffffff;
  --fam-accent-hover: #171717;
  --fam-card-bg: #ffffff;
  --fam-space: clamp(24px, 4.15vw, 80px);
  --fam-sans: 'Editorial', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fam-header-h: 90px;
}

/* ==========================================================================
   1. RESET Y AISLAMIENTO PARA ELEMENTOR
   ========================================================================== */
.fam-widget-root {
  font-family: var(--fam-sans);
  color: var(--fam-ink);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.fam-widget-root *,
.fam-widget-root *::before,
.fam-widget-root *::after {
  box-sizing: border-box;
}

.fam-container,
.container {
  margin-inline: auto !important;
  width: calc(100% - var(--fam-space, clamp(20px, 4vw, 55px)) * 2) !important;
  max-width: 1600px !important;
  box-sizing: border-box !important;
}

.fam-section,
.section {
  width: 100%;
  padding-block: 112px;
  position: relative;
  box-sizing: border-box;
}

/* Secciones, cabeceras y pies de página nunca se autolimitan
   (excepto si la propia sección ya es .container: esa la centra la
   regla de .container de arriba a 1600px) */
section.fam-section:not(.container),
section.hero:not(.container),
section.section:not(.container),
footer.site-footer:not(.container),
footer.fam-site-footer:not(.container),
header.site-header:not(.container),
header.fam-site-header:not(.container) {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
}

@media (max-width: 1100px) {
  .fam-section,
  .section {
    padding-block: 85px;
  }
}

@media (max-width: 760px) {
  :root {
    --fam-space: 20px;
    --fam-header-h: 75px;
  }
  .fam-section,
  .section {
    padding-block: 60px;
  }
}

/* ==========================================================================
   2. REVELADO AL HACER SCROLL (SCROLL REVEALS)
   ========================================================================== */
[data-reveal].will-reveal,
.fam-reveal.will-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal].visible,
.fam-reveal.visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   3. TIPOGRAFÍA Y LABELS EDITORIALES
   ========================================================================== */
.section-label,
.fam-section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 44px;
  line-height: 1.4;
  color: var(--fam-ink);
  letter-spacing: -0.01em;
}

.section-label > span,
.fam-section-label > span {
  color: var(--fam-muted);
  font-size: 12px;
  font-weight: 600;
}

.section-heading,
.fam-section-heading {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: end;
  gap: 9%;
  margin-bottom: 55px;
}

.section-heading h2,
.fam-section-heading h2 {
  font-size: clamp(2.4rem, 4.2vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 500;
  margin: 0;
}

.section-heading > div p,
.fam-section-heading > div p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--fam-muted);
  margin: 0;
  max-width: 450px;
}

@media (max-width: 760px) {
  .section-heading,
  .fam-section-heading {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 35px;
  }
}

/* ==========================================================================
   4. BOTONES Y ENLACES EDITORIALES
   ========================================================================== */
.fam-btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  line-height: 1;
}

.fam-btn-dark,
.button-dark {
  background: var(--fam-accent);
  color: var(--fam-accent-fg);
}

.fam-btn-dark:hover,
.button-dark:hover {
  background: var(--fam-ink);
  color: var(--fam-accent-fg);
  transform: translateY(-1px);
}

.fam-btn-white {
  background: #ffffff;
  color: var(--fam-accent);
  border-color: #ffffff;
}

.fam-btn-white:hover {
  background: #e8ebf5;
  color: var(--fam-accent);
}

.fam-btn svg,
.button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.fam-btn:hover svg,
.button:hover svg {
  transform: translate(3px, -3px);
}

.fam-text-link,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: gap 0.25s ease, color 0.2s ease;
  line-height: 1.3;
}

.fam-text-link:hover,
.text-link:hover {
  gap: 26px;
  color: var(--fam-accent);
}

.fam-text-link svg,
.text-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ==========================================================================
   5. DEFENSA DE IMÁGENES RESPONSIVAS (COVER & CENTRADO GLOBAL)
   ========================================================================== */
.fam-widget-root img,
.fam-image-wrap img,
.fam-hero-media img,
.hero-media img,
.fam-project-image img,
.project-image img,
.fam-editorial-photo img,
.editorial-photo img,
.editorial-header-photo img,
.image-panorama img,
.fam-service-image img,
.service-image img,
.dialog-photo img,
.founder-image img,
.team-image img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center center !important;
  display: block;
}

/* Excepción: logos de empresas deben contenerse y no recortarse */
.fam-company-logo,
.company-logo,
.company-card .company-logo,
.marquee-logo img,
.brand-logo img,
.fam-site-header .brand-logo img,
.fam-site-footer .brand-logo img {
  object-fit: contain !important;
  object-position: center center !important;
  width: auto;
  max-width: 100%;
}

/* ==========================================================================
   6. MODALES DIALOG GLOBALES
   ========================================================================== */
dialog.fam-dialog,
dialog {
  border: 0;
  width: min(840px, calc(100% - 32px));
  max-height: 90vh;
  padding: 0;
  background: var(--fam-paper);
  color: var(--fam-ink);
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  overflow: auto;
  margin: auto;
}

dialog::backdrop {
  background: rgba(10, 15, 35, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-top {
  display: flex;
  position: sticky;
  top: 0;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--fam-paper);
  z-index: 2;
  border-bottom: 1px solid var(--fam-line);
}

.dialog-top span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fam-accent);
}

.dialog-close {
  font-size: 26px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--fam-line);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--fam-ink);
}

.dialog-close:hover {
  background: var(--fam-accent);
  color: #fff;
  border-color: var(--fam-accent);
}

.dialog-content {
  padding: 32px;
}

.dialog-content h2 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 0 0 16px;
}

.dialog-content p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fam-muted);
  margin-bottom: 16px;
}

.validation-note {
  font-size: 13px;
  color: var(--fam-muted);
  padding: 16px 18px;
  border: 1px solid var(--fam-line);
  background: rgba(33, 44, 93, 0.03);
  line-height: 1.6;
  margin: 18px 0;
  border-radius: 4px;
}

.validation-note > span {
  display: block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--fam-accent);
  margin-bottom: 6px;
}

/* ==========================================================================
   7. MICROANIMACIONES ELEMENTOR
   ========================================================================== */
@keyframes famPulseBadge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(33, 44, 93, 0.4);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(33, 44, 93, 0);
  }
}

.fam-pulse-badge {
  animation: famPulseBadge 2.8s infinite ease-in-out;
}

/* ==========================================================================
   8. ELEMENTOR LAYOUT RESET & BOOTSTRAP OVERRIDE — Grupo FAM
   Neutraliza márgenes, paddings y anchos restrictivos que Elementor y los
   temas de WordPress (Bootstrap .container a 1170px, 970px, 750px) imponen.
   ========================================================================== */

/* 1. Reset total en secciones y contenedores Flexbox de Elementor (Padres) */
.elementor-section:has([class*="elementor-widget-fam"]),
.elementor-section:has(.fam-site-header),
.elementor-section:has(.site-header),
.elementor-section:has(.fam-container),
.e-con:has([class*="elementor-widget-fam"]),
.e-con--boxed:has([class*="elementor-widget-fam"]),
.e-con.e-parent:has([class*="elementor-widget-fam"]),
.e-con--full:has([class*="elementor-widget-fam"]),
.e-con:has(.fam-site-header),
.e-con:has(.site-header),
.e-con:has(.fam-container) {
  padding: 0 !important;
  --padding-top: 0px !important;
  --padding-bottom: 0px !important;
  --padding-left: 0px !important;
  --padding-right: 0px !important;
  --content-width: 100% !important;
  --container-max-width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Forzar que el contenedor boxed de Elementor no restrinja a 1140px/1024px */
.elementor-section.elementor-section-boxed:has([class*="elementor-widget-fam"]) > .elementor-container,
.e-con--boxed:has([class*="elementor-widget-fam"]) {
  max-width: 100% !important;
  width: 100% !important;
}

/* 2. Reset total en contenedores internos de Elementor (.elementor-container, .e-con-inner) */
.elementor-section.elementor-section-boxed > .elementor-container,
.elementor-section:has([class*="elementor-widget-fam"]) > .elementor-container,
.e-con-inner,
.e-con.e-con--boxed > .e-con-inner,
.e-con--boxed > .e-con-inner,
.e-con:has([class*="elementor-widget-fam"]) > .e-con-inner {
  padding: 0 !important;
  --padding-top: 0px !important;
  --padding-bottom: 0px !important;
  --padding-left: 0px !important;
  --padding-right: 0px !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* 3. Reset total en columnas y widget-wraps de Elementor */
.elementor-section:has([class*="elementor-widget-fam"]) .elementor-column,
.elementor-section:has([class*="elementor-widget-fam"]) .elementor-column-wrap,
.elementor-section:has([class*="elementor-widget-fam"]) .elementor-widget-wrap,
.elementor-column-gap-default > .elementor-column:has([class*="elementor-widget-fam"]) > .elementor-widget-wrap {
  padding: 0 !important;
  margin: 0 !important;
}

/* 4. Todos los widgets FAM y su contenedor ocupan 100% sin padding */
[class*="elementor-widget-fam"],
.elementor-widget[class*="elementor-widget-fam"] {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

[class*="elementor-widget-fam"] > .elementor-widget-container,
.elementor-widget[class*="elementor-widget-fam"] > .elementor-widget-container {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 5. Forzar que los elementos raíz ocupen el 100% (excepto si el propio
      elemento ya es .container: ese caso lo centra la regla 6 a 1600px) */
[class*="elementor-widget-fam"] > .elementor-widget-container > section:not(.container),
[class*="elementor-widget-fam"] > .elementor-widget-container > footer:not(.container),
[class*="elementor-widget-fam"] > .elementor-widget-container > header:not(.container),
[class*="elementor-widget-fam"] > .elementor-widget-container > div.image-interlude:not(.container),
[class*="elementor-widget-fam"] > .elementor-widget-container > div.fam-header-wrapper:not(.container) {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
}

/* 6. NEUTRALIZAR BOOTSTRAP Y TEMAS WP (.container con 1170px, 970px, 750px) */
@media (min-width: 1px) {
  .fam-container,
  [class*="elementor-widget-fam"] .container,
  [class*="elementor-widget-fam"] .fam-container,
  [class*="fam-"] .container,
  .fam-section-inner,
  .fam-hero-inner,
  .fam-footer-inner,
  .fam-clients-inner,
  .fam-inner-hero-inner {
    width: calc(100% - var(--fam-space, clamp(20px, 4vw, 55px)) * 2) !important;
    max-width: 1600px !important;
    margin-inline: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (min-width: 768px) {
  .fam-container,
  [class*="elementor-widget-fam"] .container,
  [class*="elementor-widget-fam"] .fam-container,
  [class*="fam-"] .container,
  .fam-section-inner,
  .fam-hero-inner,
  .fam-footer-inner,
  .fam-clients-inner,
  .fam-inner-hero-inner {
    width: calc(100% - var(--fam-space, clamp(20px, 4vw, 55px)) * 2) !important;
    max-width: 1600px !important;
  }
}

@media (min-width: 992px) {
  .fam-container,
  [class*="elementor-widget-fam"] .container,
  [class*="elementor-widget-fam"] .fam-container,
  [class*="fam-"] .container,
  .fam-section-inner,
  .fam-hero-inner,
  .fam-footer-inner,
  .fam-clients-inner,
  .fam-inner-hero-inner {
    width: calc(100% - var(--fam-space, clamp(20px, 4vw, 55px)) * 2) !important;
    max-width: 1600px !important;
  }
}

@media (min-width: 1200px) {
  .fam-container,
  [class*="elementor-widget-fam"] .container,
  [class*="elementor-widget-fam"] .fam-container,
  [class*="fam-"] .container,
  .fam-section-inner,
  .fam-hero-inner,
  .fam-footer-inner,
  .fam-clients-inner,
  .fam-inner-hero-inner {
    width: calc(100% - var(--fam-space, clamp(20px, 4vw, 55px)) * 2) !important;
    max-width: 1600px !important;
  }
}

/* 7. Cabecera (Header): sin margen superior ni padding ajeno */
.elementor-widget-fam_header {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

.fam-site-header {
  margin-top: 0 !important;
}

