/* --- GLOBAL STYLES --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px; /* Offset for anchor links */
}

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

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

a {
  color: #0a66c2;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- HEADER --- */
header {
  position: relative;
  text-align: center;
  color: #0a66c2;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: auto;
  overflow: hidden; /* Prevents background from overflowing */
}

header .bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.07;
  z-index: -1;
}

.profile-pic {
  width: 160px;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 1.5rem;
}

.profile-logo {
  width: 700px;
  max-width: 90vw;
  height: auto;
  margin-bottom: 0.75rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.contact-icons {
  margin-top: 0.75rem;
}

.contact-icons a {
  color: #0a66c2 !important;               /* CHANGED: fuerza azul */
  font-size: 1.5rem;
  margin: 0 18px;
  transition: color 0.3s;
  display: inline-flex;          /* NEW */
  align-items: center;           /* NEW */
  justify-content: center;       /* NEW */
  line-height: 1;                /* NEW */
}

.contact-icons a:visited {
  color: #0a66c2 !important;               /* CHANGED */
}

/* CHANGED: fuerza el color en el render real de FA (font y/o svg) */
.contact-icons a i,
.contact-icons a i::before,
.contact-icons a svg,
.contact-icons a svg path {
  color: #0a66c2 !important;
  fill: #0a66c2 !important;
}

.contact-icons a:hover {
  color: #084b8e !important; /* CHANGED: fuerza hover */
  text-decoration: none;
}

/* NEW: asegura hover también en el icono */
.contact-icons a:hover i,
.contact-icons a:hover i::before,
.contact-icons a:hover svg,
.contact-icons a:hover svg path {
  color: #084b8e !important;
  fill: #084b8e !important;
}

/* --- NAVBAR --- */
.navbar {
  background: #fff;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-links a {
  color: #333;
  margin: 0 20px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s;
}

.navbar-links a:hover {
  color: #0a66c2;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: #333;
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- SECTIONS & CARDS --- */
.section {
  max-width: 900px;
  margin: auto;
  padding: 2rem 1rem;
}

.section h2 {
  color: #0a66c2;
  margin-bottom: 1rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.3rem;
}

.card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card h3 i {
  margin-right: 8px;
  color: #0a66c2;
}

ul {
  padding-left: 1.5rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* --- FOOTER --- */
footer {
  background: #eee;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
  /* Adjust header for tablets and mobiles */
  header {
    padding: 2.5rem 1rem;
    min-height: auto;
  }

  .profile-pic {
    width: 120px;
  }

  .profile-logo {
    width: 520px;
    max-width: 90vw;
    margin-bottom: 0.6rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 0.9rem;
  }

  .contact-icons {
    margin-top: 0.6rem;
  }

  .contact-icons a {
    color: #0a66c2;             /* NEW: asegura azul también en móvil */
    font-size: 1.3rem;
    margin: 0 16px;
    display: inline-flex;        /* NEW */
    align-items: center;         /* NEW */
    justify-content: center;     /* NEW */
    line-height: 1;              /* NEW */
  }

  /* Adjust navbar for mobile to show links in a row */
  .navbar {
    padding: 0.5rem;
    justify-content: center;
  }

  .navbar-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .navbar-links a {
    font-size: 0.8rem; /* Make link text smaller */
    margin: 5px 8px;   /* Adjust margin to fit better */
  }
}