/*
  Grupo Attia — Base / Reset
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
}

h1 {
  font-size: var(--h1-size);
  line-height: 1.08;
}

h2 {
  font-size: var(--h2-size);
  line-height: 1.08;
}

h3 {
  font-size: var(--h3-size);
  line-height: 1.15;
}

.container {
  width: var(--container);
  margin-inline: auto;
  padding-inline: 0; /* neutraliza el padding-inline que aplica .container de Bootstrap */
}

/* ---------- Utilidades de sección (compartidas por todas las páginas) ---------- */
.section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
}

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

.section--dark .eyebrow,
.section--dark h2,
.section--dark h3 {
  color: var(--dark-text);
}

.section--dark .section-copy {
  color: var(--dark-muted);
}

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-copy {
  color: var(--muted);
  max-width: 62ch;
  margin-top: 1.25rem;
}

/* ---------- CTA final (componente compartido por Home, Construcción y Noticias;
   cada página ajusta como override local el max-width de .cta-final h2) ---------- */
.cta-final {
  position: relative;
  padding-block: clamp(5rem, 12vw, 8rem);
  text-align: center;
  overflow: hidden;
  background: var(--navy);
}

.cta-final__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cta-final__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
}

.cta-final__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 24, 33, 0.55) 0%, rgba(15, 24, 33, 0.92) 100%);
}

.cta-final .container {
  position: relative;
  z-index: 2;
}

.cta-final .eyebrow {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.cta-final h2 {
  color: var(--white);
  margin-inline: auto;
  margin-bottom: 1.25rem;
}

.cta-final p {
  color: var(--dark-muted);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: 2.25rem;
}

.cta-final__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: var(--eyebrow-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: currentColor;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--btn-size);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.95em 1.9em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--gold);
  color: var(--navy);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #c4beb0;
}

.btn--secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  color: var(--white);
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  border-color: var(--ink);
}

.btn--ghost {
  padding: 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding-bottom: 2px;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
}

.btn--sm {
  padding: 0.65em 1.3em;
  font-size: 12px;
}

/* Foco visible accesible en toda la app */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  background: var(--navy);
  color: var(--white);
  padding: 0.85em 1.5em;
  border-radius: var(--radius);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
}

/* Reveal-on-scroll (progressive enhancement).
   Importante: el estado oculto solo se activa bajo html.reveal-js, una clase que
   reveal.js añade al arrancar. Así, si el JS no llega a ejecutarse (bloqueado,
   con error, o el archivo se abrió con file:// en un navegador restrictivo),
   el contenido queda visible por defecto en vez de invisible para siempre. */
html.reveal-js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

html.reveal-js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
