/* ========== RESET Y BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  background-color: #c6becf;
  color: #333;
  min-height: 100%;
}

/* Contenedor general */
.container {
  display: grid;
  grid-template-areas:
    "header header"
    "nav nav"
    "main aside"
    "footer footer";
  grid-template-columns: 3fr 1fr;
  gap: 1rem;
  max-width: 1200px;
  margin: auto;
  padding: 1rem;
  min-height: 100vh;
}

/* ========== HEADER ========== */
.header {
  grid-area: header;
  display: flex;
  flex-direction: column; /* título debajo del logo */
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #16509b;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(211, 60, 60, 0.1);
}

.header h1 {
  font-size: 2rem;
  color: #000;
  text-align: center;
}

/* ========== NAVIGATION ========== */
.navigation {
  grid-area: nav;
  background: #10365d;
  border-radius: 12px;
}

.navigation ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.navigation a {
  display: block;
  padding: 0.8rem 1.2rem;
  text-decoration: none;
  color: #ecf0f1;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.navigation a:hover,
.navigation a:focus {
  background: #34495e;
  color: #fff;
  outline: 2px solid #0c457e;
}

.navigation a.active {
  background: #0e7e67;
  border-radius: 8px;
}

/* ========== MAIN ========== */
.main-content {
  grid-area: main;
}

/* Banner */
.banner {
  background: #317c22;
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  text-align: center;
}

/* Sección intro */
.intro {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.intro h3 {
  margin-bottom: 0.8rem;
  color: #2c3e50;
}

/* Imagen de perfil */
.perfil-img {
  width: 200px;       /* ancho fijo */
  height: 200px;      /* alto fijo */
  object-fit: cover;  /* recorta y centra la foto */
  border-radius: 50%; /* circular */
  display: block;
  margin: 1rem auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* ========== CARDS ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.card {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover,
.card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.card h3, .card h4 {
  margin-bottom: 0.5rem;
  color: #1abc9c;
}

/* ========== SIDEBAR ========== */
.sidebar {
  grid-area: aside;
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  height: fit-content; /* para que no se estire */
  position: sticky;
  top: 20px;
}

.sidebar h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
}

.sidebar a {
  display: block;
  padding: 0.5rem 0.5rem;
  color: #34495e;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s, color 0.3s;
}

.sidebar a:hover,
.sidebar a:focus {
  background: #0e9177;
  color: #fff;
}

/* ========== FOOTER ========== */
.footer {
  grid-area: footer;
  background: #2c3e50;
  color: #ecf0f1;
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* Ajustes solo para index */
body.index .footer {
  padding: 2rem 1rem;
}

body.index .container {
  min-height: 90vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .container {
    grid-template-areas:
      "header"
      "nav"
      "main"
      "aside"
      "footer";
    grid-template-columns: 1fr;
  }

  .navigation ul {
    flex-direction: column;
  }

  .banner {
    text-align: left;
  }

  .sidebar {
    width: 100%;
    position: relative;
    top: 0;
    margin-top: 1rem;
  }
}
