/* =========================================================
   CALIDAD ESPACIAL ARQUITECTURA - styles.css
   Diseño editorial minimalista. Editable y comentado.
   ========================================================= */

/* ---- 1. VARIABLES (paleta y tipografía) ---- */
:root {
  /* Colores - paleta azul editorial */
  --color-bg:        #f4f7fa;   /* fondo principal (azul muy pálido) */
  --color-bg-alt:    #e6edf3;   /* fondo alterno */
  --color-dark:      #0f1d2e;   /* azul muy oscuro (casi negro) */
  --color-text:      #1d2d3f;   /* texto principal (azul tinta) */
  --color-muted:     #5a6a7a;   /* texto secundario (azul grisáceo) */
  --color-accent:    #1e5c8a;   /* azul acero — acento principal */
  --color-accent-2:  #4a90c2;   /* azul medio para hover */
  --color-line:      #cbd5e0;   /* líneas y bordes */
  --color-light:     #ffffff;

  /* Tipografía - una sola fuente */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Espaciado */
  --container-w: 1280px;
  --space-xs: 0.5rem;
  --space-s:  1rem;
  --space-m:  2rem;
  --space-l:  4rem;
  --space-xl: 6rem;

  /* Transiciones */
  --t-fast: 0.2s ease;
  --t-slow: 0.5s ease;
}

/* ---- 2. RESET BÁSICO ---- */
*, *::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: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration: none; transition: color var(--t-fast); }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---- 3. TIPOGRAFÍA ---- */
h1, h2, h3, h4 { font-family: var(--font-body); font-weight: 600; line-height: 1.2; color: var(--color-dark); letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-s);
}
.eyebrow-light { color: var(--color-accent); }

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: var(--space-m);
  letter-spacing: -0.01em;
}
.section-title-light { color: var(--color-light); }

/* ---- 4. HEADER ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 247, 250, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  height: 72px;
  width: auto;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-line1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-dark);
}

.brand-line2 {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  text-transform: uppercase;
}

.nav { display: flex; gap: 2.5rem; }

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width var(--t-slow);
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

.phone-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.02em;
}
.phone-link:hover { color: var(--color-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  transition: transform var(--t-fast), opacity var(--t-fast);
}

/* ---- 5. HERO ---- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-image { position: absolute; inset: 0; z-index: 1; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    135deg,
    rgba(15, 29, 46, 0.78) 0%,
    rgba(15, 29, 46, 0.45) 50%,
    rgba(15, 29, 46, 0.25) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  color: var(--color-light);
  max-width: 720px;
  padding-top: 4rem;
  padding-bottom: 4rem;
  animation: fadeUp 1s ease-out;
}

.hero-content .eyebrow { color: #a8c8e0; }

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--color-light);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  margin-bottom: 1.5rem;
  color: #e0eaf3;
  max-width: 580px;
}

.hero-desc {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  color: #c5d3e0;
  max-width: 520px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- 6. BOTONES ---- */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-light);
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: transparent;
  color: var(--color-light);
  border-color: var(--color-light);
}

/* ---- 7. SECCIONES ---- */
.section { padding: var(--space-xl) 0; }

.section-dark {
  background: var(--color-dark);
  color: #c5d3e0;
}
.section-dark p { color: #a8b8c8; }

/* ---- 8. METODOLOGÍA (filas alternadas) ---- */
.section-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 4rem;
}
.section-intro .eyebrow { display: block; }

.method-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  margin-bottom: 5rem;
}
.method-row:last-child { margin-bottom: 0; }

.method-row-reverse .method-text { order: 2; }
.method-row-reverse .method-img  { order: 1; }

.method-text h3 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  color: var(--color-dark);
}
.method-text p { color: var(--color-muted); font-size: 1.0625rem; }

.method-img img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border: 1px solid var(--color-line);
}

/* ---- 9. PRINCIPIOS GRID ---- */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  margin-top: 3rem;
}

.principle {
  display: flex;
  flex-direction: column;
}

.principle-img {
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.05);
  display: flex;
  justify-content: center;
  align-items: center;
}
.principle-img img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.principle h3 {
  font-size: 1.5rem;
  color: var(--color-light);
  margin-bottom: 0.75rem;
}
.principle p { color: #a8b8c8; font-size: 0.95rem; }

/* ---- 10. CTA PROYECTOS ---- */
.cta-section { background: var(--color-bg-alt); }

.cta-inner {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: center;
}

.cta-text p { margin-bottom: 2rem; color: var(--color-muted); }

.cta-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- 11. FOOTER ---- */
.site-footer { background: var(--color-dark); color: #a8b8c8; padding-top: 4rem; }

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-light);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.footer-tag { font-size: 0.875rem; color: #7a8ba0; }

.site-footer h4 {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-light);
  margin-bottom: 1.25rem;
  font-family: var(--font-body);
}

.footer-contact p, .footer-nav a { display: block; margin-bottom: 0.5rem; font-size: 0.95rem; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid #1f3146;
  padding: 1.5rem 0;
  font-size: 0.8125rem;
  color: #5a6a7a;
}

/* ---- 12. PROYECTOS PAGE ---- */
.projects-hero {
  padding: var(--space-xl) 0 var(--space-l);
  text-align: center;
  border-bottom: 1px solid var(--color-line);
}
.projects-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.projects-hero p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: 1.0625rem;
}

/* Cada proyecto como bloque editorial separado */
.project {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-line);
}
.project:last-child { border-bottom: none; }

.project-header {
  margin-bottom: 3rem;
  text-align: center;
}
.project-header .eyebrow { margin-bottom: 0.5rem; }
.project-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.01em;
}

/* ===== GALERÍA SEPARADA POR ORIENTACIÓN =====
   Dentro de cada proyecto:
   - Las imágenes horizontales se agrupan en una fila uniforme
   - Las imágenes verticales se agrupan en otra fila uniforme
   Esto evita filas desalineadas SIN aplicar zoom a las imágenes:
   cada foto se muestra a su tamaño nativo o menos. */
.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

/* Fila de horizontales: tarjetas de ~400px de ancho */
.gallery-row-h figure {
  flex: 0 1 400px;
}

/* Fila de verticales: tarjetas más angostas (~280px) */
.gallery-row-v figure {
  flex: 0 1 280px;
}

.project-gallery figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 29, 46, 0.06);
  overflow: hidden;
}

.project-gallery .img-wrap {
  /* sin altura fija, sin aspect-ratio: la imagen manda */
  background: var(--color-bg-alt);
  display: block;
}

.project-gallery img {
  /* La imagen NUNCA se amplía más allá de su tamaño nativo.
     Solo se reduce si la celda es más pequeña. */
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  /* tope absoluto para verticales muy altas (no afecta a horizontales) */
}

.project-gallery figcaption {
  padding: 1rem 1.25rem 1.25rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.project-gallery figcaption strong {
  display: block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.35rem;
  letter-spacing: -0.005em;
}

/* ---- 13. RESPONSIVE ---- */
@media (max-width: 960px) {
  .container { padding: 0 1.5rem; }

  .method-row { grid-template-columns: 1fr; gap: 2rem; margin-bottom: 4rem; }
  .method-row .method-text { order: 2; }
  .method-row .method-img  { order: 1; }
  .section-intro { margin-bottom: 3rem; }

  .principles-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  .cta-inner { grid-template-columns: 1fr; gap: 2rem; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: span 2; }

  .project-gallery { gap: 1.25rem; }
  .gallery-row-h figure { flex: 0 1 340px; }
  .gallery-row-v figure { flex: 0 1 240px; }
}

@media (max-width: 720px) {
  .nav, .phone-link { display: none; }
  .nav-toggle { display: flex; }

  .header-inner { height: 76px; }
  .brand-logo { height: 48px; }
  .brand-line1 { font-size: 1rem; }
  .brand-line2 { font-size: 0.75rem; }

  .hero { min-height: 75vh; }
  .hero-content { padding: 3rem 0; }

  .section { padding: var(--space-l) 0; }

  .btn { padding: 0.875rem 2rem; font-size: 0.8125rem; }

  .gallery-row-h figure,
  .gallery-row-v figure { flex: 0 1 100%; max-width: 380px; }

  /* Menú móvil desplegable */
  .nav.is-open {
    display: flex;
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--color-line);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  }
  .nav.is-open .nav-link { font-size: 1rem; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}

/* ---- 14. UTILIDADES ---- */
.text-center { text-align: center; }
