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

/* esquema académico */
:root {
  --primary: #002b5c;      /* azul marino universidad */
  --primary-dark: #001b3c;
  --accent: #c69c6d;        /* dorado suave */
  --bg: #fafafa;
}

/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: #202124;
  line-height: 1.5;
}

header {
  background: var(--primary);
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header h1 {
  font-family: 'Merriweather', serif;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-size: 2rem;
}

header form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

header input,
header select {
  padding: 0.5rem;
  font-size: 1rem;
}

header button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
}

header button:hover {
  background: #a57d4f;
}

/* Grid mejorado */
.grid {
  display: grid;
  gap: 2rem;
  padding: 2rem 5%;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

/* Contenedor de portada con proporción 2:3 */
.cover {
  position: relative;
  width: 100%;
  padding-top: 150%; /* 2:3 ratio */
  background: #f5f5f5;
}

.cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card {
  border: 1px solid rgba(0,43,92,0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s;
}

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

.card img {
  width: 100%;
  height: 320px;
  width: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  transition: filter 0.3s;
}

.card:hover img { filter: brightness(0.9); }

.card h3 {
  min-height: 48px;
  line-height: 1.2;
  overflow: hidden;
  font-family:'Merriweather',serif;font-weight:700;
}

.card p {margin: 0 0 0.25rem 0;}

.card .buttons {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  justify-content: center;
}

.card .buttons a {
  display: inline-block;
  flex: none;
  width: auto;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  padding: 0.4rem 0.2rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.card .buttons a:hover {
  background: #a57d4f;
}

#load-more {
  display: block;
  margin: 2rem auto;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  background: #202020;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#load-more.hidden {
  display: none;
}

/* Loader spinner */
.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #ff4d00;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 3rem auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.stats {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #ccc;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  position: relative;
  width: 90%;
  height: 90%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

#pdf-frame {
  flex: 1;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.page-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.page-btn:disabled { opacity: 0.4; cursor: default; }

#page-info { font-weight: 600; } 

.tagline {
  margin-bottom:1rem;
  font-weight:500;
} 

.pdf-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #f0f0f0;
  padding: 1rem;
}

.pdf-page {
  margin: 0 auto 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
} 

body      { font-size: 16px; }
h1        { font-size: 2.2rem; }
.card h3  { font-size: 1rem; line-height: 1.3; }
.card p   { font-size: 0.85rem; color:#555; }

.card      { border-radius:8px; box-shadow:0 1px 4px rgba(0,0,0,.08); }
.card:hover{ transform:translateY(-3px); box-shadow:0 6px 16px rgba(0,0,0,.12);}

header form    { max-width:600px; margin-inline:auto; }
header input   { flex:1; border-radius:24px 0 0 24px; }
header button  { border-radius:0 24px 24px 0; }

.chip{display:inline-block;padding:0 6px;border-radius:4px;
      background:#e8e8e8;font-size:.7rem;color:#333;margin-right:4px;}

.page-btn   { background:var(--primary); min-width:100px; }
#page-info  { font-size:.9rem; letter-spacing:.5px; }

*{transition:background .2s,color .2s,box-shadow .25s,transform .25s;} 