/* ==========================================================================
   1. Variables y Estilos Base
   ========================================================================== */
:root {
  --color-primary: #122E5D;
  --color-secondary: #FD5902;
  --color-text: #333;
  --color-light: #fff;
  --color-background: #f5f5f5;
  --font-main: "Quicksand", sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
}

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

/* ==========================================================================
   2. Header y Navegación
   ========================================================================== */
header {
  background-color: var(--color-primary);
  color: var(--color-light);
  padding: 1.25rem 1.5rem;
  text-align: center;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

header .logo {
  width: 6.25rem; /* 100px */
  height: auto;
  margin: 0 auto 0.625rem;
}

header h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  letter-spacing: 0.125rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

nav ul li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: var(--color-primary);
  color: var(--color-light);
  border-radius: 0.3125rem;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.3s ease;
}

nav ul li a:hover {
  background: var(--color-secondary);
}

/* ==========================================================================
   3. Contenido Principal: Idiomas
   ========================================================================== */
#idiomas {
  padding: 2.5rem 1.5rem;
  background-color: var(--color-light);
  border-radius: 0.625rem;
  box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.1);
  max-width: 76.25rem; /* 1220px */
  margin: 2.5rem auto;
}

.idiomas-container {
  max-width: 75rem; /* 1200px */
  margin: 0 auto;
}

.idiomas-title, .subs {
  text-align: center;
  color: var(--color-primary);
  font-weight: 600;
}

.idiomas-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  border-bottom: 3px solid var(--color-secondary);
  padding-bottom: 0.625rem;
  margin-bottom: 0.625rem;
  display: inline-block; /* Ajusta el borde al texto */
}

.subs {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 2rem;
}

.subs-grid {
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  color: var(--color-light);
  background-color: var(--color-secondary);
  padding: 0.75rem 1rem;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
  font-weight: 600;
}

/* Grid de Idiomas - Inteligente y Responsivo */
.idiomas-grid {
  display: grid;
  /* Esta línea hace toda la magia: crea columnas que no bajan de 160px
     y se ajustan solas. ¡No necesita media queries! */
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); /* 160px */
  gap: 2.5rem; /* 40px */
  padding: 2.5rem;
  background-color: var(--color-secondary);
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

.idioma-card {
  background: var(--color-light);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.idioma-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,0.15);
}

.idioma-card img {
  width: 6.25rem; /* 100px */
  height: 6.25rem;
  margin: 0 auto 1rem;
}

.idioma-card p {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

/* Bloques de información horizontales */
.idiomas-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 3rem;
}

.idiomas-block {
  flex: 1 1 18.75rem; /* Base de 300px, flexible */
  background-color: var(--color-light);
  border-left: 5px solid var(--color-secondary);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,0.08);
}

.idiomas-subtitle {
  color: var(--color-primary);
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

/* Logos de Certificaciones */
.certification-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.logo-box {
  width: 7.5rem; /* 120px */
  height: 3.75rem; /* 60px */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--color-light);
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.logo-box:hover {
  transform: scale(1.05);
  box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.2);
}

.logo-box img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* ==========================================================================
   4. Footer
   ========================================================================== */
footer {
  text-align: center;
  padding: 1.25rem;
  background: var(--color-primary);
  color: var(--color-light);
  font-size: 1rem;
  margin-top: 2.5rem;
}