/* 
  global.css
  Estilos globales, reseteos, configuración tipográfica y layout base
  de acuerdo a typography.md y layout.md
*/

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-white);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 
  ### Typography Scale ###
*/

/* Display Heading */
.font-display {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 400;
  line-height: 1.12;
  color: var(--text-primary);
}

/* Heading One */
h1, .font-h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.12;
  color: var(--text-primary);
}

/* Heading Two */
h2, .font-h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.0;
  color: var(--text-primary);
}

/* Heading Three */
h3, .font-h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.0;
  color: var(--text-primary);
}

/* Body (Default is defined in body tag but creating class just in case) */
.font-body {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Caption */
.font-caption {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.0;
  color: var(--text-secondary);
}

/* Label */
.font-label, label, .eyebrow {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* Utility Links & Selection */
a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a.active-link {
  color: var(--text-emphasis);
}

/* 
  ### Layout Utilities ### 
*/

/* Contenedor principal responsive */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-4xl);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
}

/* Ritmo vertical entre secciones de página */
section, .section-gap {
  padding: var(--spacing-4xl) 0;
  margin-bottom: var(--spacing-3xl);
}

/* Grillas Flexibles */
.grid-3-cols {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-lg);
  flex-wrap: nowrap;
}

.grid-3-cols > * {
  flex: 1;
}

.grid-2-cols {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-3xl); /* 40-64px allowed, picking 64px for max breathability */
}

.grid-2-cols > * {
  flex: 1 1 50%;
}

.grid-4-cols {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-lg);
  flex-wrap: nowrap;
}

.grid-4-cols > * {
  flex: 1;
}

@media (max-width: 1024px) {
  .grid-3-cols, .grid-2-cols {
    flex-wrap: wrap;
  }
  .grid-3-cols > * {
    flex: 1 1 calc(50% - var(--spacing-lg));
  }
  .grid-4-cols {
    flex-wrap: wrap;
  }
  .grid-4-cols > * {
    flex: 1 1 calc(50% - var(--spacing-lg));
  }
}

@media (max-width: 768px) {
  .grid-3-cols, .grid-2-cols, .grid-4-cols {
    flex-direction: column;
    gap: var(--spacing-xl);
  }
  .grid-3-cols > *, .grid-2-cols > *, .grid-4-cols > * {
    flex: 1 1 100%;
  }
}

/* Divider Visual */
.divider {
  width: 100%;
  height: 1px;
  background-color: var(--divider);
  border: none;
  margin: var(--spacing-lg) 0;
}
