
/* ------------------------------------------------------------ */
/* 2. RESET & BASE                                              */
/* ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-navy);
  background-color: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ------------------------------------------------------------ */
/* 3. UTILITIES                                                  */
/* ------------------------------------------------------------ */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-xl);
}

.section--light {
  background-color: var(--color-light);
}

.section--navy {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.section--navy-dark {
  background-color: var(--color-navy-dark);
  color: var(--color-white);
}

.section-label {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-red);
  display: block;
  margin-bottom: var(--space-xs);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-navy);
}

.section-title--white {
  color: var(--color-white);
}

.section-title--center {
  text-align: center;
}

.section-divider {
  width: 48px;
  height: 4px;
  background-color: var(--color-red);
  margin-top: var(--space-sm);
}

.section-divider--center {
  margin-inline: auto;
}

/* Visually hidden (accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}


/* ------------------------------------------------------------ */
/* 4. BUTTONS                                                    */
/* ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85em 1.75em;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color var(--ease-default), transform var(--ease-default), box-shadow var(--ease-default);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background-color: var(--color-red);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-red-dark);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}

.btn--outline:hover {
  background-color: var(--color-white);
  color: var(--color-navy);
}

.btn--ghost {
  background-color: transparent;
  color: var(--color-navy);
  padding-inline: 0;
  gap: 0.4rem;
  font-size: var(--text-sm);
}

.btn--ghost .arrow {
  transition: transform var(--ease-default);
}

.btn--ghost:hover .arrow {
  transform: translateX(4px);
}

.btn--ghost:hover {
  transform: none;
  box-shadow: none;
}

/* ------------------------------------------------------------ */
/* SCROLL REVEAL                                                */
/* ------------------------------------------------------------ */
/*
 * The original pages each carried these rules in an inline <style> block in
 * <head>, placed AFTER the stylesheet. The theme never received them, so every
 * `reveal` class on the template parts was inert and the block-managed content
 * carried none at all — the entrance animations were simply absent.
 *
 * Why an animation rather than the original's transition.
 *
 * The original used `transition` for this, which meant that wherever a
 * component declares its own `transition` — the service cards, the pillar
 * cards, the empresa cards, the product cards and the sectores items all do —
 * this rule silently replaced it. Those components then lost the smooth hover
 * on their border, background and shadow.
 *
 * An animation composes with a transition instead of replacing it, so the card
 * keeps its hover while the block still fades and rises. The motion is the
 * same; only the mechanism differs.
 *
 * `backwards` fill is what makes the stagger work: it applies the start state
 * during `animation-delay`, and — unlike `both` — releases the element
 * afterwards so the component's own transform applies again.
 */
.reveal {
  opacity: 0;
}

.reveal.revealed {
  opacity: 1;
  animation: aes-reveal 0.6s ease backwards;
}

@keyframes aes-reveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.reveal--delay-1 { animation-delay: 0.1s; }
.reveal--delay-2 { animation-delay: 0.2s; }
.reveal--delay-3 { animation-delay: 0.3s; }
.reveal--delay-4 { animation-delay: 0.4s; }

/*
 * The stagger inside a grid. The original put `reveal--delay-N` on each item by
 * hand, one step per column, so a row appears left to right; these rules derive
 * the same thing from the item's position, which survives the client reordering
 * cards.
 *
 * One deviation, deliberate: on the pillars grid the original's second row ran
 * one step later than its first (0,1,2 then 1,2,3) — an authoring slip, not a
 * design. Rows are uniform here.
 */
.services-grid > *:nth-child(3n + 1),
.empresas__grid > *:nth-child(3n + 1) { animation-delay: 0.1s; }

.services-grid > *:nth-child(3n + 2),
.empresas__grid > *:nth-child(3n + 2) { animation-delay: 0.2s; }

.services-grid > *:nth-child(3n + 3),
.empresas__grid > *:nth-child(3n + 3) { animation-delay: 0.3s; }

.capacidad-operativa__pillars-grid > *:nth-child(3n + 1) { animation-delay: 0s; }
.capacidad-operativa__pillars-grid > *:nth-child(3n + 2) { animation-delay: 0.1s; }
.capacidad-operativa__pillars-grid > *:nth-child(3n + 3) { animation-delay: 0.2s; }

.product-grid > *:nth-child(4n + 1) { animation-delay: 0s; }
.product-grid > *:nth-child(4n + 2) { animation-delay: 0.1s; }
.product-grid > *:nth-child(4n + 3) { animation-delay: 0.2s; }
.product-grid > *:nth-child(4n + 4) { animation-delay: 0.3s; }

.home-certificaciones .wp-block-column:nth-child(1) { animation-delay: 0s; }
.home-certificaciones .wp-block-column:nth-child(2) { animation-delay: 0.1s; }
.home-certificaciones .wp-block-column:nth-child(3) { animation-delay: 0.2s; }
.home-certificaciones .wp-block-column:nth-child(4) { animation-delay: 0.3s; }
.home-certificaciones .wp-block-column:nth-child(5) { animation-delay: 0.4s; }
.home-certificaciones .wp-block-column:nth-child(6) { animation-delay: 0.5s; }

/* The sectores grid staggered in pairs rather than by column. */
.industrias__grid > *:nth-child(-n + 2) { animation-delay: 0.1s; }
.industrias__grid > *:nth-child(n + 3):nth-child(-n + 4) { animation-delay: 0.2s; }
.industrias__grid > *:nth-child(n + 5) { animation-delay: 0.3s; }

/*
 * Safety the original did not have.
 *
 * `.reveal` hides content until JavaScript reveals it, so a browser with
 * scripting off would show a blank page. The original accepted that risk; a
 * media query costs nothing and a <noscript> rule in header.php covers the
 * rest. Reduced motion is an accessibility fix the original never made.
 */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    animation: none;
  }
}
