/* ==========================================================================
   Variables - Paleta de Color Oficial M++ 
   ========================================================================== */
:root {
  --azul-real: #00389e;
  --azul-bruma: #8badde;
  --negro-puro: #000000;
  --blanco-puro: #ffffff;
  
  /* Tipografía Inter Variable / Fallback Arial */
  --font-principal: 'Inter', Arial, sans-serif;

  /* 
    SELECTOR DE FONDO 
    Opciones: 'script' | 'image' | 'color'
  */
  --bg-mode: 'script'; 
}

/* ==========================================================================
   Reseteo Global y Estilos Base
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-principal);
  
  /* FALLBACKS NATIVOS */
  background-color: var(--blanco-puro); 
  background-image: url('background.jpg');
  
  background-size: cover; 
  background-attachment: fixed; /* Mantiene la imagen y el script quietos al scrollear */
  background-position: center;

  color: var(--negro-puro);
  line-height: 1.6;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

/* ==========================================================================
   Tipografía y Jerarquía
   ========================================================================== */
h1 {
  font-weight: 900;
  font-size: 4.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--azul-real);
  margin-bottom: 1.5rem;
}

h2 {
  font-weight: 800;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--negro-puro);
}

p {
  font-weight: 400;
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
  max-width: 75ch;
}

.small {
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--azul-bruma);
  margin-bottom: 1rem;
}

.statement {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--azul-real);
  margin-top: 3rem;
  padding-left: 1.5rem;
  border-left: 4px solid var(--azul-real);
}

/* ==========================================================================
   Header y Navegación
   ========================================================================== */
header {
  padding: 2rem 5%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  
  /* Usamos un fondo ligeramente transparente para que se vea el fondo (script o imagen) por debajo */
  background-color: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(8px);
  
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--azul-real);
  letter-spacing: -0.03em;
}

nav {
  display: flex;
  gap: 2.5rem;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--azul-real);
}

/* Enlaces Greyed Out */
nav a.disabled, 
.edition a.disabled {
  color: rgba(0, 0, 0, 0.25);
  pointer-events: none;
  cursor: default;
  border-bottom-color: transparent;
}

.links-grid a.disabled-link {
  color: rgba(0, 0, 0, 0.2);
  pointer-events: none;
  cursor: default;
}

.links-grid a.disabled-link span {
  color: rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Layout Principal y Secciones
   ========================================================================== */
main {
  max-width: 1400px;
  margin: 0 auto;
}

section {
  padding: 6rem 5%;
}

.content {
  max-width: 800px;
}

/* ==========================================================================
   Secciones Específicas
   ========================================================================== */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-description {
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--negro-puro);
  margin-top: 1rem;
}

.jaime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.jaime-grid .image {
  background-color: var(--azul-bruma);
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  overflow: hidden; /* Asegura que la imagen no se salga del contenedor */
}

.edition a {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--azul-real);
  border-bottom: 2px solid transparent;
}

.edition a:hover {
  border-bottom-color: var(--azul-real);
}

.links {
  padding-bottom: 8rem;
}

.links-grid {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--negro-puro);
}

.links-grid a {
  display: flex;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--negro-puro);
}

.links-grid a span {
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--azul-bruma);
  width: 80px;
  display: inline-block;
}

.links-grid a:hover:not(.disabled-link) {
  color: var(--azul-real);
  padding-left: 2rem;
}

.links-grid a:hover:not(.disabled-link) span {
  color: var(--azul-real);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  background-color: var(--negro-puro);
  color: var(--blanco-puro);
  padding: 4rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

footer strong {
  display: block;
  font-weight: 900;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

footer p {
  color: var(--azul-bruma);
  font-size: 0.875rem;
  margin-bottom: 0;
}

footer div:last-child {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

footer a {
  font-weight: 500;
  font-size: 0.875rem;
}

footer a:hover {
  color: var(--azul-bruma);
}

/* Estado deshabilitado exclusivo para el footer (fondo negro) */
footer a.disabled {
  color: rgba(255, 255, 255, 0.25); /* Blanco al 25% de opacidad */
  pointer-events: none;
  cursor: default;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2rem; }
  .header-container { flex-direction: column; gap: 1.5rem; }
  nav { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .jaime-grid { grid-template-columns: 1fr; }
  .links-grid a { font-size: 1.75rem; padding: 1.5rem 0; }
  footer { flex-direction: column; }
}

/* ==========================================================================
   Páginas Interiores y Botones (Convocatorias)
   ========================================================================== */

/* Hero más pequeño para páginas que no son el Home */
.hero.inner-hero {
  min-height: 40vh;
  justify-content: flex-end;
  padding-bottom: 2rem;
}

/* Contenedor de botones */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 3.5rem;
}

/* Estilo base del Botón */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center; /* O flex-start si prefieres el texto a la izquierda */
  padding: 1.25rem 2.5rem;
  background-color: var(--negro-puro);
  color: var(--blanco-puro);
  font-weight: 600;
  font-size: 1.125rem;
  border: 2px solid var(--negro-puro);
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  background-color: var(--azul-real);
  border-color: var(--azul-real);
  color: var(--blanco-puro);
  transform: translateY(-2px); /* Pequeño salto elegante al pasar el mouse */
}

/* Botón transparente para documentos de lectura (Bases) */
.btn.outline {
  background-color: transparent;
  color: var(--negro-puro);
}

.btn.outline:hover {
  background-color: var(--negro-puro);
  color: var(--blanco-puro);
  border-color: var(--negro-puro);
}

/* Responsive para botones */
@media (max-width: 768px) {
  .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}