/* ===== FUENTE ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* ===== COLOR POR ÁREA =====
   Se activa con <body class="idiomas"> (o matematicas, ciencias, etc.).
   Si el body no tiene clase, se usa el índigo por defecto.
   Los colores coinciden con las tarjetas del inicio (card-1 a card-6). */
:root {
  --color-area: #3f51b5;
  --color-header: #3f51b5; /* fijo: el header es igual en toda la página */
}

body.matematicas  { --color-area: #3f51b5; } /* índigo  = card-1 */
body.idiomas      { --color-area: #e74c3c; } /* rojo    = card-2 */
body.ciencias     { --color-area: #16a085; } /* verde   = card-3 */
body.deportes     { --color-area: #f39c12; } /* naranja = card-4 */
body.nemotecnias  { --color-area: #9b59b6; } /* morado  = card-5 */
body.psicologia   { --color-area: #2c98c0; } /* azul    = card-6 */

/* ===== BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', Arial, Helvetica, sans-serif;
}

body {
  background: #f5f7fa;
  color: #333;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: white;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

header a {
  text-decoration: none;
  color: #333;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.25rem;
  font-weight: bold;
}

.logo img {
  height: 70px;
  border-radius: 50%;
}

nav a {
  margin-left: 18px;
  padding: 10px 16px;
  border-radius: 14px;
  transition: .3s;
}

nav a:hover {
  background: var(--color-header);
  color: white;
}

/* ===== SECCIÓN CENTRAL ===== */
.centro {
  max-width: 1100px;
  margin: 40px auto;
  background: white;
  padding: 50px;
  border-radius: 28px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.centro img {
  width: 180px;
  border-radius: 50%;
  margin-bottom: 20px;
}

.boton {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background: #e74c3c;
  color: white;
  text-decoration: none;
  border-radius: 16px;
}

/* ===== TARJETAS ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 1fr; /* todas las filas con la misma altura */
  gap: 20px;
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
}

.card {
  background: white;
  padding: 25px;
  border-radius: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  border-top: 6px solid transparent;
  transition: transform .2s;
  width: 100%;
  height: 100%; /* ocupa toda la celda */
}

.card:hover {
  transform: translateY(-4px);
}

.card-1 { border-top-color: #3f51b5; }
.card-1 h3 { color: #3f51b5; }

.card-2 { border-top-color: #e74c3c; }
.card-2 h3 { color: #e74c3c; }

.card-3 { border-top-color: #16a085; }
.card-3 h3 { color: #16a085; }

.card-4 { border-top-color: #f39c12; }
.card-4 h3 { color: #f39c12; }

.card-5 { border-top-color: #9b59b6; }
.card-5 h3 { color: #9b59b6; }

.card-6 { border-top-color: #2c98c0; }
.card-6 h3 { color: #2c98c0; }

.card-link {
  display: flex; /* para que la tarjeta interna se estire */
  text-decoration: none;
  color: inherit;
}

.card-link h3,
.card-link p {
  text-decoration: none;
  color: inherit;
}

/* ===== FOOTER ===== */
footer {
  margin-top: 40px;
  background: white;
  padding: 20px;
  text-align: center;
  border-radius: 20px 20px 0 0;
}

/* ===== RESPONSIVE (header) ===== */
@media (max-width: 760px) {
  header {
    flex-direction: column;
    gap: 12px;
    padding: 15px 20px;
  }

  nav a:first-child {
    margin-left: 0;
  }
}

/* ===== ENCABEZADO DE ÁREA (opcional) ===== */
.encabezado-area {
  max-width: 1000px;
  margin: 40px auto 0;
  padding: 0 20px;
}

.encabezado-area h1 {
  font-size: 1.8rem;
  color: var(--color-area);
}

.encabezado-area h1::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--color-area);
}

.encabezado-area p {
  margin-top: 10px;
  color: #666;
}

.encabezado-area + .lista-pdf {
  margin-top: 24px;
}

/* ===== LISTA DE PROYECTOS ===== */
.lista-pdf {
  list-style: none;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.item-pdf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: #fff;
  border-radius: 14px;
  border-left: 5px solid var(--color-area);
  padding: 22px 28px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s, box-shadow 0.25s;
  animation: aparecer 0.5s ease backwards;
}

.item-pdf:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.item-pdf:nth-child(2) { animation-delay: 0.08s; }
.item-pdf:nth-child(3) { animation-delay: 0.16s; }
.item-pdf:nth-child(4) { animation-delay: 0.24s; }
.item-pdf:nth-child(5) { animation-delay: 0.32s; }
.item-pdf:nth-child(n+6) { animation-delay: 0.4s; }

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-pdf {
  flex: 1;
  min-width: 0;
}

.info-pdf h3 {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.info-pdf p {
  margin: 0;
  color: #555;
  font-size: 0.92rem;
}

.acciones-pdf {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* --- Botón "Explorar proyecto" (usa el color del área) --- */
.boton-pdf {
  background: var(--color-area);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.boton-pdf:hover,
.boton-pdf:focus-visible {
  background: var(--color-area);
  background: color-mix(in srgb, var(--color-area) 80%, black);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.boton-pdf:active {
  transform: translateY(0);
  box-shadow: none;
}

/* --- Botón "Póster" --- */
.boton-poster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #5f6368;
  text-decoration: none;
  border: 1px solid #c9ccd1;
  border-radius: 8px;
  background: #fff;
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s, background 0.25s,
              transform 0.25s, box-shadow 0.25s;
}

.boton-poster svg {
  transition: transform 0.25s;
}

.boton-poster:hover,
.boton-poster:focus-visible {
  color: var(--color-area);
  background: #e8eaf6;
  background: color-mix(in srgb, var(--color-area) 12%, white);
  border-color: var(--color-area);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.boton-poster:hover svg,
.boton-poster:focus-visible svg {
  transform: scale(1.12);
}

.boton-poster:active {
  transform: translateY(0);
  box-shadow: none;
}

/* --- Menos movimiento (accesibilidad) --- */
@media (prefers-reduced-motion: reduce) {
  .item-pdf {
    animation: none;
    transition: none;
  }

  .boton-pdf,
  .boton-poster,
  .boton-poster svg {
    transition: none;
  }

  .item-pdf:hover,
  .boton-pdf:hover,
  .boton-poster:hover {
    transform: none;
  }
}

/* ===== RESPONSIVE (proyectos) ===== */
@media (max-width: 760px) {
  .encabezado-area h1 {
    font-size: 1.5rem;
  }

  .item-pdf {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }

  .acciones-pdf {
    flex-wrap: wrap;
  }
}