@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --escala: 1;
  --color-bg: #F2F2F7;
  --color-card: #FFFFFF;
  --color-texto: #1C1C1E;
  --color-texto-sec: #8E8E93;
  --color-borde: #E5E5EA;
  --color-blue: #007AFF;
  --color-purple: #AF52DE;
  --color-green: #34C759;
  --color-orange: #FF9500;
  --color-red: #FF3B30;
}

html {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-size: calc(100% * var(--escala));
  background-color: var(--color-bg);
  color: var(--color-texto);
  scroll-behavior: smooth;
}

.dark {
  --color-bg: #1C1C1E;
  --color-card: #2C2C2E;
  --color-texto: #EBEBF5;
  --color-texto-sec: #98989F;
  --color-borde: #48484A;
}

body {
  background-color: var(--color-bg);
  color: var(--color-texto);
  min-height: 100vh;
}

/* Pestañas activas */
.tab-activa {
  background-color: var(--color-blue);
  color: #fff;
  border-color: var(--color-blue);
}

/* Line clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Focus visible accesible */
:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Botones mínimo 44x44px (salvo overrides inline) */
[data-tab] { min-height: 44px; min-width: 44px; }

/* Animación de carga */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Dialog */
dialog {
  border: none;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  background: var(--color-card);
  color: var(--color-texto);
}
dialog::backdrop {
  background: rgba(0,0,0,.4);
}

/* Panel Autores */
.autores-continente { margin-bottom: 28px; }
.autores-continente-cabecera {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-borde);
}
.autores-continente-icono { font-size: 1.2rem; }
.autores-continente-nombre { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-texto-sec); }
.autores-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-autor-panel {
  height: 40px; padding: 0 16px; border-radius: 20px;
  border: 1.5px solid var(--color-borde);
  background: var(--color-card);
  color: var(--color-texto);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-autor-panel:hover {
  background: var(--color-blue); color: #fff;
  border-color: var(--color-blue);
  box-shadow: 0 2px 8px rgba(0,122,255,.25);
}
.btn-autor-panel .pais {
  font-weight: 400; font-size: 0.75rem;
  opacity: .65; margin-left: 4px;
}
.btn-mas-panel {
  height: 40px; padding: 0 16px; border-radius: 20px;
  border: 1.5px dashed var(--color-borde);
  background: transparent; color: var(--color-texto-sec);
  font-size: 0.875rem;
  transition: color .15s, border-color .15s;
}
.btn-mas-panel:hover { color: var(--color-blue); border-color: var(--color-blue); }

/* Modal custom */
#blg-modal-autores {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
#blg-modal-autores > div {
  background: var(--color-card);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 560px;
  width: 94%;
  max-height: 80vh;
  overflow-y: auto;
}
